You are here

Question about the Data\settings directory contents

13 posts / 0 new
Last post
bill_gagliardi
bill_gagliardi's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2008-11-05 22:44
Question about the Data\settings directory contents

I'm making a launcher for an app that's already portable, and ran into a road block. There is an ini file in the Data\settings directory that contains the last drive and last directory the app was run from. My question is this, how do you deal with the portable app being moved.

For example, say the app is located at My Documents\Dropbox\Portable\PortableApps\SimplePortForwardingPortable at home, but at c:\Dropbox\Portable\PortableApps\SimplePortForwardingPortable at work. The contents of the SimplePortForwardingPortableSettings.ini between the two will be different. I don't believe simply deleting the Data directory is the correct solution (though it would work).

I've spent 2 days looking through and reading all sorts of stuff in the development area, but I'm still no closer to solving this. I'm sure I've probably read how to do this, but I'm still lost. Anyone mind illuminating the clueless?? Please?

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 3 weeks ago
DeveloperModerator
Joined: 2008-07-24 18:46
PackagePartialDir

Take a look in the manual at the PackagePartialDir variable. It's used in most of our launchers now to deal with that exact scenario.

bill_gagliardi
bill_gagliardi's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2008-11-05 22:44
Can I

Can I ask a stupid question about that? I can see in the manual PAL:PackagePartialDir belongs in the [FileWriteN] section of the launcher.ini, but how do you use it? The manual shows the example \PortableApps\AppNamePortable, but that doesn't show it's usage. Do I just put in the following?

[FileWriteN]
PAL:PackagePartialDir

I feel like there is something missing from this. Am I being dense again?

Bill G.
Frozen St. Paul, MN
land of the frozen mosquito

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 3 weeks ago
DeveloperModerator
Joined: 2008-07-24 18:46
update paths in config files

You would use it to update paths in config files.

[FileWriteN]
Type=Replace
File=%PAL:DataDir%\nameoffile
Find=%PAL:LastPackagePartialDir%
Replace=%PAL:PackagePartialDir%

bill_gagliardi
bill_gagliardi's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2008-11-05 22:44
Hmm

Thanks for being so patient Gord. I must be really dense today, because I'm still having trouble. Here's what I did. I copied the text in your last message stating with [FileWriteN], and put it in my SimplePortForwardingPortable\App\AppInfo\Launcher\SimplePortForwardingPortable.ini. I replaced "nameoffile" with SimplePortForwardingPortableSettings.ini. Now that file reads as:

[Launch]
ProgramExecutable=spf\spf.exe
WorkingDirectory=%PAL:AppDir%\spf

[FileWriteN]
Type=Replace
File=%PAL:DataDir%\SimplePortForwardingPortableSettings.ini
Find=%PAL:LastPackagePartialDir%
Replace=%PAL:PackagePartialDir%

The file I'm having trouble with is \SimplePortForwardingPortable\Data\settings\SimplePortForwardingPortableSettings.ini

The current contents of it is:
[SimplePortForwardingPortableSettings]
LastDrive=C:
LastDirectory=\Portable\PortableApps\SimplePortForwardingPortable
[PortableApps.comLauncherLastRunEnvironment]
PAL:LastPortableAppsBaseDir=C:\Portable

The error I get when I move the directory is right here.

Am I even close, or did it butcher it up even worse?

Bill G.
Frozen St. Paul, MN
land of the frozen mosquito

Pyromaniac
Pyromaniac's picture
Offline
Last seen: 9 years 1 week ago
Developer
Joined: 2008-09-30 19:18
don't worry about it

The file you mentioned, Data\settings\SimplePortForwarding.ini is actually a file automatically generated by the launcher (SimplePortForwardingPortable.exe) and it's contents are actually the settings that the launcher reads in order for its "PackagePartialDir" and "Drive" variables, so you don't need to worry about that.

Also, the message box your getting occurs whenever the app's path without the drive letter changed (such as :\PortableApps to :\NewFolder\PortableApps). Some apps have issues when this happened, but not all of them, so the message was coded into the launcher as a warning in case something went wrong with the app. If you know your app works in that scenario (which it generally should), you can add the following lines to your launcher under the [Launch] section:

DirectoryMoveOK=yes

On the other hand, if you know your portable app won't work when it's directory is changed, you can set it to no. The default value that produced the message was warn.

bill_gagliardi
bill_gagliardi's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2008-11-05 22:44
Thank you

Thank you for the explanation (and the solution). That actually made sense to me. I appreciate the help.

Bill G.
Frozen St. Paul, MN
land of the frozen mosquito

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 3 weeks ago
DeveloperModerator
Joined: 2008-07-24 18:46
post dev test

Are you planning to post a dev test? If so, please do, so we can give advice accordingly.

bill_gagliardi
bill_gagliardi's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2008-11-05 22:44
Absolutely

I'll be posting it tonight when I'm at work. It would be good to get feedback. The last 3 that I've posted have gotten no comments at all. I was starting to get a little frustrated (just a little).

Bill G.
Frozen St. Paul, MN
land of the frozen mosquito

depp.jones
Online
Last seen: 34 min 35 sec ago
DeveloperTranslator
Joined: 2010-06-05 17:19
As Gord said. It's better

As Gord said. It's better most of the times to have something to 'work' with that to guess.

An explanation to the things you encountered:
Most portable versions work well if the directory is moved around. The DirectoryMoveOK setting is there to deal with that.
But moving apps aroung may break some of its functionality like recent files lists, path settings. located in a settings file etc. To deal with that, you can use FileWriteN to change the entries in that settings file (N is an ascending number for every FileWriteN section you use (FileWrite1, FileWrite2... ).
AppNamePortableSettings.ini is a working file for the launcher and should not be altered.

To get the idea, it's best to have a look at the setup of an existing app. (Audacity IcoFX or CamStudio are rather transparent)

-edit-
corrected typo in format tags.

bill_gagliardi
bill_gagliardi's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2008-11-05 22:44
Thanks

Thanks depp.jones. I think I'll be saving your comment as a text file on my system for reference ( as well as Gord's and Pyromaniac's). I seem to have trouble understanding the manual. That is my issue with reading comprehension rearing it's ugly head again. Thanks to all 3 of you for your simpler explanations and for your patience. It is greatly appreciated. Smile

Bill G.
Frozen St. Paul, MN
land of the frozen mosquito

depp.jones
Online
Last seen: 34 min 35 sec ago
DeveloperTranslator
Joined: 2010-06-05 17:19
Exactly the same happened to

Exactly the same happened to me when I first tried to set up my first app. Blum

bill_gagliardi
bill_gagliardi's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2008-11-05 22:44
Posted

Bill G.
Frozen St. Paul, MN
land of the frozen mosquito

Log in or register to post comments