You are here

More about PAL ini syntax

8 posts / 0 new
Last post
Devildevilscle
Offline
Last seen: 12 years 2 months ago
Joined: 2010-11-08 13:18
More about PAL ini syntax

1. Recently i made an app that we usually use at work portable. Yesterday, i borrowed one of my friends laptop and used my portable app on it. The laptop have the same app i made portable installed on it. Hours after i returned his laptop, my friend phoned me complaining that he's program installed(the one i made portable) was somewhat non-functional anymore. This app stores it's settings at the registry. On my Launcher.ini i have

[RegistryCleanUpForce]
HKCU\Software\AppName

Was it possible that my portable app swept-away\cleaned even the registry keys of the same app w/c was installed at the laptop?

2. And, may someone pls explain further the section
[RegistryValueBackupDelete]?

Aluísio A. S. G.
Offline
Last seen: 8 years 2 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Possibly

1. RegistryCleanUpForce seems to remove the registry keys, being they present or not before. If you want to backup that key, you can use:

[RegistryKeys]
-=HKCU\Software\AppName

2. RegistryValueBackupDelete backups values (the entries at right in RegEdit).

Previously known as kAlug.

Devildevilscle
Offline
Last seen: 12 years 2 months ago
Joined: 2010-11-08 13:18
Ok

I'll try it first.

-:O =

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 3 months ago
Joined: 2007-04-15 21:08
Caution

The [RegistryKeys] -=... structure was only implemented specially in PAL 2.1; in PAL 2.0 it will create and store it in Data\settings\-.reg

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

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 3 months ago
Joined: 2007-04-15 21:08
Don't use it

You shouldn't use [RegistryCleanUpForce]. I can't even clearly remember why I implemented it; at the time though custom code wasn't possible, so that may have been the reason. I plan on removing it and a couple of other sections in 2.2.

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

Devildevilscle
Offline
Last seen: 12 years 2 months ago
Joined: 2010-11-08 13:18
So,

So, what should i do then? From the manual it says that

"If you do not wish to save the data of the registry key to a file but only want to keep it safe and throw away any changes, set the “file name” to - , so you end up with -=registry key location ."

as i understand it, it only pre-empts in creating a .reg output file at data\settings. And thus throwing away any changes, given that you'll place all reg & values at [RegistryValueWrite]. But when the portable app starts & run, it will still load the apps reg key's data on the registry and might still be left there after exit, right or wrong?
It seems to me also that using (replace appname w/) -=reg key will also pre-empt changes,making the app to run and start always on default, w/c is not what i need.

And also from the manual

"If the registry key exists when the launcher comes to load the portable data, it will be backed up, and restored at the end, so that no data is lost"

this part of the manual (dealing w/ the registry) answers my questions(but i still need to test it). The manual did not stated anything for me to do for that to happen so therefore I assume its already a PAL's default action Re situations where the reg keys already exist.

From the manual's worked example

[Launch] ProgramExecutable = 7-Zip\7zFM.exe

[Activate] Registry = true

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

[RegistryKeys] 7zip_portable = HKEY_CURRENT_USER\Software\7-Zip

Here, the example did not used any [RegistryCleanup...] section. So it means that the portable registry will be automatically deleted upon app's exit. Right.

So I will no longer use [RegistryCleanupForce] then. Thx. I'll confirm after trying it.

-:O =

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 3 months ago
Joined: 2007-04-15 21:08
-

Using [RegistryKeys]:- is correct; my caution with it is purely informational, that it will save the data in PAL 2.0, which could have undesirable side-effects if you want it to have a fresh key each time. Most of the time it won't matter though.

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

Devildevilscle
Offline
Last seen: 12 years 2 months ago
Joined: 2010-11-08 13:18
Late reply

I was'nt able to test the [registrykey] :- format. What i did was just this:
1. Replaced [. . .cleanupforce] w/ [. . .cleanupifempty]
2. Used the appname=hkcu\software\appname format.

And it worked fine on me. On pc's w/ no installed app, it did'nt left any regkey on the registry. On pc's w/ installed app, the installed app's settings on the reg was not modified neither deleted.

-:O =

Log in or register to post comments