Hi folks,
I just started with portable apps. My goal ist to make an qt-based app portable to run from an USB flash drive. This app uses no registry keys but unfortunately it places somes data in the directory where Windows environment variable "%USERPROFILE% points to.
I read in this forum and tuts about the possibility to create an individual launcher for that app. So I started from scratch, portet the app into the portable apps format and wrote an AppInfo.ini and a launcher.ini. I thougth it would be possible to redirect the Windows environment variables within the launcher.ini. But now I´m not so sure about that...
I tried follwing code in the launcher.ini:
[Environment]
USERPROFILE=%PAL:DataDir%
But that doesn´t work. Portable apps Launcher rans over it and created an .exe to start. With this .exe my app starts fine but still uses the USERPROFILE directory on the host machine.
Is there anything more to do or is it simply not possible to redirect environment variables with a Laucher so that I´m forced to write my own installer?
regards
Michael
Redirecting USERPROFILE is rarely a safe action; changing it breaks the Windows file picker and other things. In the PortableApps.com Launcher, use [DirectoriesMove] or [FilesMove] to achieve the same result.
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
Hi Chris and thanks 4 help.
Using [DirectoriesMove] solved my problem. I had this tought before but wasn´t sure to manage the directories possibly existing. But the backup function works fine.
regards
Michael
Mine uses %APPDATA%.. But when i run in my username,i get all the same settings.. But when i run it under different username the settings are reverted back to the default..
There is no substitute for experience...
If a ShGetFolderLocation or similar call is used to find APPDATA (the recommended way) then you can't just change APPDATA without special care, and there are still negative side-effects (I had a script to do it but stopped it after I realised the full implications of it). In that case, just move it.
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