You are here

WorkingDirectory in Stickies Portable

7 posts / 0 new
Last post
PortableApps Việt
PortableApps Việt's picture
Offline
Last seen: 6 months 5 days ago
Joined: 2012-05-07 21:34
WorkingDirectory in Stickies Portable

Hi,

I used Stickies Portable and I have a question. StickiesPortable.ini file (App\AppInfo\Launcher) has command

[Launch]
WorkingDirectory=%PAL:DataDir%
DirectoryMoveOK=yes

And I test by remove WorkingDirectory=%PAL:DataDir% command then pack it by PortableApps.comLauncher again. As a result it leaves "stickies" folder in %Appdata%.

So I wonder which type of software can use command WorkingDirectory in [Launch]? I try some software but it can't work as Stickies Portable.

If you use WorkingDirectory command, DirectoryMoveOK command is useful?

Anyone can help me! Thank you very much!

Ken Herbert
Ken Herbert's picture
Offline
Last seen: 4 hours 22 min ago
DeveloperModerator
Joined: 2010-05-25 18:19
Different apps, different requirements

Some apps (like Stickies) use the working directory to determine where data is saved, while others use the working directory to find and access files in its own directory (or a sub-directory).

Generally, if an app does not require the working directory to be set, you should not use it.

There is no link between WorkingDirectory and DirectoryMoveOK.

PortableApps Việt
PortableApps Việt's picture
Offline
Last seen: 6 months 5 days ago
Joined: 2012-05-07 21:34
Thanks. About %PATH% variable?

Ok. I see. And WorkingDirectory mean set location for %PATH% variable environment? And if Stickies Portable doesn't set for %PATH%, it will use default location, %APPDATA%. So if I have 2, or 3,...portable apps also use WorkingDirectory, is %PATH% variable conflict?

Sorry I'm amatuer so I don't understand why portable apps (made by PortableApps.comLauncher) can change %PATH% variable while apps (main apps) know about that? For example, StickiesPortable.exe use WorkingDirectory, and new location for %PATH% is %PAL:DataDir%. And I wonder why does stickies.exe is launched after understand? There is link between StickiesPortable.exe and stickies.exe in this situation?

Thank winterblood for your reply. I appreciate that.

Ken Herbert
Ken Herbert's picture
Offline
Last seen: 4 hours 22 min ago
DeveloperModerator
Joined: 2010-05-25 18:19
A few misconceptions

WorkingDirectory does not affect the %PATH% environment variable in any way. It is linked to a system variable called %CD%, but it is not a true environment variable.

WorkingDirectory is just a reference point that says "I am here", and can be set separately for each running process. In the Windows command prompt, using the "cd" command to change directory is just changing the working directory for that process.

Even environment variables can be set differently for each process. The PortableApps Platform uses this so the Updater runs installers silently and the Platform itself can tell the Launchers which language to run in.

PortableApps Việt
PortableApps Việt's picture
Offline
Last seen: 6 months 5 days ago
Joined: 2012-05-07 21:34
Oh, it's nice!

Thanks. Now, I can make Stickies Portable by copy 2 files: stickies.ini & store.mdb from DefaultData folder to stickies folder. And I run stickies.exe directly. I think Stickies Portable is good example for me to understand cd variable. Stickies also make portable as SumatraPDF, use DirectoryMoveOK!

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 10 hours 59 min ago
DeveloperModerator
Joined: 2008-07-24 18:46
not quite

running stickies.exe means you aren't running portably anymore. While running it how you say allows you to run it mostly portably, it doesn't meet our definition of portable, and may leave files behind on any computer you use.

PortableApps Việt
PortableApps Việt's picture
Offline
Last seen: 6 months 5 days ago
Joined: 2012-05-07 21:34
Tested!

Yes. But in this situation, I can. Because stickies.exe does not affect system after it quit such as leaves files if 2 files stickies.ini and store.mdb contain in the same folder with stickies.exe file. You can test! Because %cd% variable also works the same thing!

Log in or register to post comments