Need Help with redirecting 1 file

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.
Message
Author
chezduong
Posts: 67
Joined: Mon Jan 15, 2007 6:14 am

Need Help with redirecting 1 file

#1 Post by chezduong »

All,

Atto Disk Benchmarking Tool is a small free disk benchmarking tool (duh). It is nearly portable because it does not use the registry at all. The only thing that it does is save a file named bench32.ini into the Windows folder.

Using the below ini file (this is the complete ini file), I have managed to get the program to save the bench32.ini file directly to a Data\Files\Windows folder within the application's folder. But when I "save" a benchmark result, the saved file also gets saved to a Data\Files\User folder within the application folder on my USB key.

My question is how can I save my files somewhere else like the My Documents folder on C:\ without actually saving it to the Data\Files\User folder within the application folder on my USB key? I have tried many different combinations of FilesystemInclude/FilesystemExclude and ModuleInclude/ModuleExclude including 1=* and exclude arguments, but the saved file keeps going back into Data\Files\User folder within the application folder.

By the way, I deleted everything after the [SpecialFolders] line.

Can anyone help? Thanks.

Code: Select all

[Registry]
Use=1
Data=.\Data\Registry\%appname%.reg

[Filesystem]
Use=1
Data=.\Data\Files\

[RegistryExclude]
1=HKEY_CURRENT_USER\Software\Microsoft\DirectInput
2=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket
3=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32
4=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable
5=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
6=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints
7=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2
8=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
9=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams
10=HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam
11=HKEY_LOCAL_MACHINE\Software\Microsoft\Direct3D
12=HKEY_LOCAL_MACHINE\Software\Microsoft\DirectDraw
13=HKEY_LOCAL_MACHINE\Software\Microsoft\DirectInput
14=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket
15=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
16=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings
17=HKEY_LOCAL_MACHINE\System\CurrentControlSet

[RegistryInclude]

[RegistryIgnore]

[FilesystemExclude]

[FilesystemInclude]

[FilesystemIgnore]

[ModuleExclude]

[ModuleInclude]
1=%appname%.exe

[SpecialFolders]
Download:
http://www.xcso.com/download2.htm
(second green download button on the right side of the screen)

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

#2 Post by redllar »

Give this a try. It should put the bench32.ini in the same dir as the exe. Everything else should be left alone.

Code: Select all

[Registry]
Use=0

[Filesystem]
Use=1
Data=.\

[RegistryExclude]
1=*

[FilesystemExclude]
1=*

[FilesystemInclude]
1=%36%\bench32.ini

[ModuleExclude]
1=*

[ModuleInclude]
1=%appname%.exe

[SpecialFolders]
36=.\

chezduong
Posts: 67
Joined: Mon Jan 15, 2007 6:14 am

Wow...

#3 Post by chezduong »

Wow...it works perfectly. Thank you very much.

I'll mess around with it some more to see if I can put the file in the Data\Files\Windows folder.

Thanks again.

chezduong
Posts: 67
Joined: Mon Jan 15, 2007 6:14 am

Question bis

#4 Post by chezduong »

Just curious, why does everything work fine in the above when the registry redirection is off, but no longer works when the registry redirection is on? aren't the registry and the filesystem redirections independent from one another?

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

Re: Question bis

#5 Post by redllar »

chezduong wrote:aren't the registry and the filesystem redirections independent from one another?
Yes, they are independent of one another. In fact, for the 020 release they will probably be in separate dlls.
chezduong wrote:Just curious, why does everything work fine in the above when the registry redirection is off, but no longer works when the registry redirection is on?
I can't really answer this as it's just too vague. Is "in the above" referring to your ini or mine? What do you mean by "but no longer works?" What specifically no longer works? How did you turn the registry redirection on?

I did a quick test by taking my ini and setting [Registry]Use=1 and everything still works as before, i.e., I can still save .bmks to the desktop, to "My Documents," etc.

chezduong
Posts: 67
Joined: Mon Jan 15, 2007 6:14 am

#6 Post by chezduong »

"In the above" referred to mine, but I'll try yours. "No longer works" means that when quiting, the bench32.ini is saved back to the Windows directory.

I'll try again with your original code, changing the registry redirection to 1 and see what happens.

Thanks for the other information.

chezduong
Posts: 67
Joined: Mon Jan 15, 2007 6:14 am

#7 Post by chezduong »

Retried it a couple of times. Copied and pasted from your last code posted. Added the 3rd line. It saves the bench32.ini file to the Windows directory. The complete ini file is below.

Code: Select all

[Registry]
Use=1
Data=.\

[Filesystem]
Use=1
Data=.\

[RegistryExclude]
1=*

[FilesystemExclude]
1=*

[FilesystemInclude]
1=%36%\bench32.ini

[ModuleExclude]
1=*

[ModuleInclude]
1=%appname%.exe

[SpecialFolders]
36=.\ 

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

#8 Post by redllar »

I just tried the ini contents you posted and the bench32.ini still gets stored into the app directory.

So I'm thinking it might be the jauntePE dll version. Check to see that the jauntepe dll (not the exe) file's version is 0.1.2. You can do that by right-clicking on the file in explorer, selecting Properties, and then selecting the Version tab.

If it's not 0.1.2 then you'll need to change the "1=%36%\bench32.ini" line to read "1=36" instead. This will cause everything the app attempts to create, modify, or delete in the "Windows" directory to be redirected instead of just the bench32.ini file, as the "%folder#%\path" syntax is new to 0.1.2.

chezduong
Posts: 67
Joined: Mon Jan 15, 2007 6:14 am

Yup 0.1.2

#9 Post by chezduong »

The Dll is 0.1.2.

But for some reason, the JauntePE.exe file is marked as 0.1.0 even though I am certain that I downloaded the 0.1.2 zip file and overwrote the 0.1.0 (twice).

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

#10 Post by redllar »

But for some reason, the JauntePE.exe file is marked as 0.1.0 even though I am certain that I downloaded the 0.1.2 zip file and overwrote the 0.1.0 (twice).
The exes still indicate an 0.1.0 version as none of their code has changed and I keep forgetting to reshack the distributed exe files to change their version info.
The Dll is 0.1.2.
Okay, I think I figured it out, sort of.

What's happening is that this is an MFC app, verified by running the app in Discovery mode. If you do this, edit the jauntePE_discovery.ini file and search for bench32.ini manually as JPE currently has no way to report file system usage via its gui. Doing this you'll find that bench32.ini is being used by mfc42.dll, not bench32.exe as I had thought.
(Make sure to delete the %Windows%\bench32.ini afterwards to avoid later confusion.)

You can also quickly verify it's an MFC app by looking at the exe with Depends.

Since it's an MFC app, most of the app's system-oriented work is done via the MFC runtime, not the app's exe. So, adding a "2=mfc42.dll" line (sans quotes) to the [ModuleInclude] list gets the bench32.ini redirected as expected, whether registry redirection is on or off.

What I haven't figured out yet is why having registry redirection turned off makes the file system redirection work for this particular case. I know it has something to do with the module lists usage but I'll need to look into it further. At least the basics aren't yet proven to be broken as I was beginning to think.

chezduong
Posts: 67
Joined: Mon Jan 15, 2007 6:14 am

Works like a charm

#11 Post by chezduong »

Works like a charm. I'll have to try out the Discovery mode.

Thanks.

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

#12 Post by redllar »

Okay, I found the bug causing this weird situation.

If registry redirection is turned off then the module exclusion/inclusion settings are not read in, resulting in a default of testing all modules for redirection. So even with the incorrect module name in the module inclusion list, the redirection occurs, making it look like the app is using bench32.ini as opposed to the MFC runtime. With registry redirection turned on the module settings are read in and used, causing the bench32.ini redirection to fail since the app doesn't use it.

In either case adding the correct module (mfc42.dll) to the module inclusion list will cause bench32.ini to be redirected as expected.

I'll try and put out a new jauntePE dll with a fix for this asap as it impacts performance when registry redirection is turned off.

chezduong
Posts: 67
Joined: Mon Jan 15, 2007 6:14 am

#13 Post by chezduong »

You the MAN!

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

#14 Post by redllar »

You the MAN!
Yes, I am the "idiot who can't even put code where it should be placed" man.

User avatar
joby_toss
Posts: 2970
Joined: Sat Feb 09, 2008 9:57 am
Location: Romania
Contact:

#15 Post by joby_toss »

Sorry for reviving an old thread but I also need help redirecting a file.

I have an app (myDiary) that always saves its settings in "?root drive?\myDiary\Data\".
If I use

Code: Select all

[FilesystemInclude]
1=C:\myDiary
everything is ok as long as I start the app from C drive (settings are always saved in "JPE config folder\Unknown\Data\".

What should I use so the settings would always be saved in my JPE config folder no matter the drive name/letter ?

Post Reply