You are here

Portableapps.com Launcher: Registry path handling?

7 posts / 0 new
Last post
Gremlin
Offline
Last seen: 3 weeks 19 hours ago
Joined: 2010-07-02 04:48
Portableapps.com Launcher: Registry path handling?

Hi all,

I am trying to portabilize software with Chris Morgan's PortableApps.com Launcher 2.0 and so far have been successful with three apps which do not need any registry entries but only need to move around files. The launcher is really great and it was a breeze to make software portable so far.

Now I have run into a problem with the fourth project: there are two registry entries and without them the software refuses to start. One of the registry entries contains the path to the software's installation folder while the other points to the MyDocuments folder of a user. Now I have gotten it to start by putting the absolute paths in the .reg file to the portable apps folder the software resides in. But this is not portable at all. I have read the Launcher's manual and the forums to find a hint how to do this but I did not find any clue. Maybe someone more experienced than me could point me in the right direction.

My launcher.ini file called mysoftware.ini looks like this:


[Launch]
ProgramExecutable=MySoftware\System\main.exe
WorkingDirectory=%PAL:AppDir%\MySoftware
SinglePortableAppInstance=true
SingleAppInstance=true
LaunchAfterSplashScreen=true

[Activate]
Registry=true

[FileWrite1]
Type=Replace
File=%PAL:DataDir%\settings\mysoftware_portable.reg
Find=%PAL:LastDrive%\\
Replace=%PAL:Drive%\\

[RegistryKeys]
mysoftware_portable=HKLM\Software\SoftwareCompany\MySoftware

[RegistryCleanupIfEmpty]
1=HKLM\Software\SoftwareCompany\MySoftware
2=HKLM\Software\SoftwareCompany

[DirectoriesMove]
savefiles=%DOCUMENTS%\MySoftwareSaveFiles

The registry file 'mysoftware_portable.reg' in Data/settings:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\SoftwareCompany\MySoftware]
"MYSOFTWARE_ROOT"="H:\\PortApps\\SoftwareCompany\\MySoftware Portable\\App\\MySoftware"
"SaveFilesPath"="C:\\Documents And Settings\\username01\\MyDocuments\\MySoftwareSaveFiles"

How could I replace the paths in the 'mysoftware_portable.reg' file with the actual path were the software resides in and with the SaveFilesPath where each user's savefiles reside in? If I move the software around on hard drives or USB sticks the paths should be adjusted automatically. I could not find any reference or example in the manual how to do so. Should this be done with the environment variavbles like %PAL:AppDir%? I tried this but it did not work out.

Help please?

Gremlin

Mark Sikkema
Offline
Last seen: 12 years 7 months ago
Developer
Joined: 2009-07-20 14:55
[RegistryValueWrite]
[RegistryValueWrite]
HKLM\Software\SoftwareCompany\MySoftware\SaveFilesPath=REG_SZ:%PAL:DataDir%\savefiles

The following is not necessary(the launcher deals with it):

[RegistryCleanupIfEmpty]
1=HKLM\Software\SoftwareCompany\MySoftware

So, just use:

[RegistryCleanupIfEmpty]
1=HKLM\Software\SoftwareCompany

Formerly Gringoloco
Windows XP Pro sp3 x32

Gremlin
Offline
Last seen: 3 weeks 19 hours ago
Joined: 2010-07-02 04:48
Ah,I see. This was the

Ah,I see. This was the missing link. I could not figure out how to do it. Thank you very much.

An additional question: with [RegistryValueWrite] would I also adjust the first path and should it look this way?


[RegistryValueWrite]
HKLM\Software\SoftwareCompany\MySoftware\MYSOFTWARE_ROOT=REG_SZ:%PAL:AppDir%\MySoftware
HKLM\Software\SoftwareCompany\MySoftware\SaveFilesPath=REG_SZ:%PAL:DataDir%\savefiles

Should I then leave the savefiles in the Data/savefiles directory and work with them in there or do I still need to move them to the %DOCUMENTS%\MySoftwareSaveFiles folder with


[DirectoriesMove]
savefiles=%DOCUMENTS%\MySoftwareSaveFiles

Cheers

Gremlin

Mark Sikkema
Offline
Last seen: 12 years 7 months ago
Developer
Joined: 2009-07-20 14:55
You're welcome

1. Yes
2. Yes

But, I suppose you have to test it yourself to see if it behaves the way you'd like.

Formerly Gringoloco
Windows XP Pro sp3 x32

Gremlin
Offline
Last seen: 3 weeks 19 hours ago
Joined: 2010-07-02 04:48
Success!

Just for the record. I had to remove


[DirectoriesMove]
savefiles=%DOCUMENTS%\MySoftwareSaveFiles

and the software could work with the files directly in the Data/savefiles directory within the portable app folder structure.

All works fine now and I have learned another step. Thank you, Gringoloco.

Cheers

Gremlin

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
[Launch] values

(I think Gringoloco's answered all your questions above.)

I've got a few other comments on your launcher.ini content, in the [Launch] section.

SinglePortableAppInstance=true makes launching a second copy of the portable version not work. Is this necessary? I doubt it should be.

SingleAppInstance=true is the default value and by preference should be omitted.

LaunchAfterSplashScreen=true should also probably be left out; it slows down execution as it waits for the splash screen to close before actually launching the app. As noted in the manual, that's only needed for resolution-changing games.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Gremlin
Offline
Last seen: 3 weeks 19 hours ago
Joined: 2010-07-02 04:48
Thanks, Chris. Your

Thanks, Chris. Your recommendations make sense but in this case it is an (older) game. I will remove SingleAppInstance=true per your recommendation but I understood the other options are useful in this case.

The launcher is great and makes portabilizing software easy. Thanks for your efforts. I still do not understand everything but slowly make my way and will later on move to more complex scenarios.

Cheers

Gremlin

Log in or register to post comments