Question on file redirection

Discuss anything related to JauntePE, the utlimate utility to help you tame non-portable applications. Share your experience about the apps that work with JauntePE, and the apps that don't.
Post Reply
Message
Author
BAHeath
Posts: 15
Joined: Tue Aug 07, 2007 8:49 pm
Location: USA

Question on file redirection

#1 Post by BAHeath »

Hello

I am new to JauntePE and have had some trouble trying to portablize my first app DVDFabHDDecrypter3.1.6.0.

When I have file redirection turned on and run the app it will freeze, I then have to use Task Manager to kill it.

If I turn off file redirection I can get the app to run to a point where it crashes because it is looking for some files from the program folder. If I copy the files over manually to the portable app directory then it runs without crashing.

My confusion is I thought with the redirection turned on it would pull any necessary files into the portable app directory automatically.

Any feedback would be appreciated

User avatar
Local
Posts: 238
Joined: Fri Aug 03, 2007 3:48 am

#2 Post by Local »

I think it might be worth reading all of the other posts in the forum on this subject.

As far as I know JPE cannot move files.
What it does is redirect your application in where it looks for and stores files and reg entries.

You should be able to redirect your program to look for the files in the home directory but you must place them there yourself.

There are plenty of instructions on the forum to help you understand

I found most of my answers here
http://www.portablefreeware.com/forums/ ... php?t=1968

User avatar
Firewrath
Posts: 321
Joined: Mon Aug 28, 2006 2:36 pm

#3 Post by Firewrath »

Local wrote: As far as I know JPE cannot move files.
What it does is redirect your application in where it looks for and stores files and reg entries.
Actually, JPE does move files when the file redirection is on,
if you JPE notepad and then save a text file on the desktop, itll get redirected, generally to "<app>.exe\filesystem\desktop\<file>"

what JPE Cant do (yet? ...as its an interesting idea,)
is take an app thats already installed, check what files its using, then move them to a redirected folder,

if you install an app through JPE though, it will catch and move those file for you, but it doesnt work with all installers,

BAHeath
Posts: 15
Joined: Tue Aug 07, 2007 8:49 pm
Location: USA

#4 Post by BAHeath »

Thanks Firewrath that was the answer I needed.

I had misunderstood how the redirection works.

I think I understand now... so if the application looks for these extra files in the same folder as the executable, then I could move them into my own dir structure like ".\bin\files" or something similar then turn on redirection add the path in the ini and it should work.

User avatar
Local
Posts: 238
Joined: Fri Aug 03, 2007 3:48 am

#5 Post by Local »

I'm confused now.
if you JPE notepad and then save a text file on the desktop, itll get redirected, generally to "<app>.exe\filesystem\desktop\<file>
Isn't that only directing where to store files?

If you opened a txt file on the desktop with a JPE notepad and saved it, would the file be actually moved to your "<app>.exe\filesystem\desktop" folder?

I think I'd find that a little too interfering.

Btw, has anyone any ideas of apps to test for file redirection?
Almost everything I have ever needed to JPE-ize has been all Reg entries.

The only app I own that would need files redireting is photoshop and I'm really not ready to attempt that yet

Chris
Posts: 106
Joined: Sun Dec 03, 2006 10:08 am

#6 Post by Chris »

My confusion is I thought with the redirection turned on it would pull any necessary files into the portable app directory automatically.
Redirection do not copy the files necessary, becaus it could save too much files if the application needs to read many files system. Basically this is how redirection works:

1) an app makes a request to make use of a registry key

2) JPE looks in its own portable registry for that particular app to see if that key exists - that portable registry only has the contents of the .reg file (plus any previous mods to it made by the app that got redirected) - also, this portable registry might exist in the file system or in-memory - it depends upon the in-memory portable .reg usage option in use

3) if the key exists there, then JPE tricks the app into using it so that all subsequent accesses using that key are flagged as "in portable - not system"

4) if the key doesn't exist there, then JPE passes the request on to the system registry api function that will then process the request normally.

Above explanation is about the same with File System regarding the redirection, except exist in the memory.
If you opened a txt file on the desktop with a JPE notepad and saved it, would the file be actually moved to your "<app>.exe\filesystem\desktop" folder?
Yes, unless you are using this setting in the ini:

Code: Select all

[FilesystemExclude]
1=0
2=16
3=25
That setting tells JauntePE not to redirect file saved to Desktop by that application (in this case notepad).
I'm not sure yet about the numbers, but if I'm not mistaken we wouldn't need to know it with the new GUI.
Btw, has anyone any ideas of apps to test for file redirection?
Almost everything I have ever needed to JPE-ize has been all Reg entries.
If you want, you can try to JPEized ObjectDock. It is dirty, it creates reg entries and creates files in system.

redllar
Posts: 411
Joined: Thu Aug 03, 2006 7:52 pm
Contact:

#7 Post by redllar »

Hi guys. I LOVE that you're getting into answering and discussing these types of questions and are willing to now jump in there. THANK YOU SO MUCH!

I don't have time now to read through all of the posts as thoroughly as I'd like, but what I'd like to make sure is pointed out is that JPE does, or at least it SHOULD, redirect MODIFIED files. If you find otherwise then it's a bug and I'd love to know the conditions when it occurs so that I can fix it.

My thoughts around JPE was to not do any unnecessary work. Moving directories and files around that are only read or used and not modified is just counter-intuitive to me. It also could lead to your entire hard drive being duplicated within one app's directory.

So, to extend the "existing file on the desktop" example a bit. Assuming desktop redirection is turned on, of course. Please keep that in mind. Also please keep in mind that the default file system redirection, once in use, is to redirect everything. It's up to YOU to tell JPE how intrusive not to be.

What JPE does for file system redirection is very simple. As Chris pointed out, it is very similar to registry use and redirection, but it's not exactly the same.

An app requests to use (open) a desktop file:

- If a redirected equivalent for that file exists the system is told to open the redirected file.

- If no redirected equivalent exists and the app wants to open with read-only intent, the system is told to open the desktop file.

- If no redirected equivalent exists and the app wants to open with modification intent, JPE immediately copies the desktop file to its redirected equivalent's location and the system is told to open the redirected file.

That's it in a nutshell. As you can see, just as with the registry entries, it's definitely possible to have 2 copies of a file lying around. One in the redirected file system directories and one on the desktop.

BAHeath
Posts: 15
Joined: Tue Aug 07, 2007 8:49 pm
Location: USA

#8 Post by BAHeath »

Thanks everyone for helping to clarify this for me.

I understand how JPE works alot better now!

Post Reply