You are here

[RegistryKeys] and .reg key deletion

12 posts / 0 new
Last post
Ambimind
Offline
Last seen: 12 years 7 months ago
Joined: 2010-10-20 18:39
[RegistryKeys] and .reg key deletion

Hello everyone,

I've been working with the registry features of PAL. I've been successful at creating and deleting keys using [RegistryKeys](from a .reg file), [RegistryCleanupIfEmpty] - pretty cool! I have a curious problem however:

Briefly: All registry key-branches from "appnameportable.reg", accept the (one) specified through the [RegistryKeys] section, are being deleted. When two [RegistryKeys] are specified(as bellow) only the second is kept.

----

In detail:

- In the "\settings\appnameportable.reg" I have two different key-branches - one holds software registration information, the other holds window size/position information.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\EzySoft\InstInvCashBk\Info]
"Data"=hex:0a,...[censored]...

[HKEY_CURRENT_USER\Software\EzySoft\InstInvCashBk\Screen]
"SCR_HSize"="1115"
"SCR_VSize"="680"
"SCR_Top"="0"
"SCR_Left"="63"

- My laucher.ini look like this:

 
[Launch]
ProgramExecutable=InstantInvoiceCashBook\InstantInvoiceCashBook.exe
SingleAppInstance=true

[Activate]
Registry=true

[RegistryKeys]
InstantInvoiceCashBookPortable=HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\EzySoft\InstInvCashBk\Info
InstantInvoiceCashBookPortable=HKEY_CURRENT_USER\Software\EzySoft\InstInvCashBk\Screen

[RegistryCleanupIfEmpty]
1=HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\EzySoft\InstInvCashBk
2=HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\EzySoft\ 
.......

- After running the program with above configurations the .reg file is modified to exclude the first key-branch.

- I have a solution in mind using [FileMove] from "\appnameportable" but its seems like an extra step I could be avoiding?

Thanks for any assistance,
Ambimind

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
Separate files

You must put different keys in different files - meaning, a different INI key for the two different values in RegistryKeys.

Also you should check how this app behaves on XP as well (assuming you've got Vista or 7) before every releasing it - the VirtualStore stuff works differently between operating systems. You may find it tricky to get working properly; you may need to have it require admin.

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

Ambimind
Offline
Last seen: 12 years 7 months ago
Joined: 2010-10-20 18:39
I see, thanks. Regarding the

I see, thanks.
Regarding the "virtualstore" issue, I had no idea. I think I may have to limit its use to vista/7 anyway, one of my [FileMove]'s makes reference to vista/7's "documents" folder which doesn't exist in XP. Since quite a few software/games save data in my_documents/documents is there some way around this?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
%DOCUMENTS%

It's covered in the Manual in the document Environment variable substitions. I think you'll find that does what you want?

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

Ambimind
Offline
Last seen: 12 years 7 months ago
Joined: 2010-10-20 18:39
Pardon me, yes exactly. Much

Pardon me, yes exactly. Much appreciated.

EDIT: Btw, I just tested the app in XP SP3 and while the program runs fine the registration information isn't copied across - on an administrator account. I'll see if I can post back with a solution.

Ambimind
Offline
Last seen: 12 years 7 months ago
Joined: 2010-10-20 18:39
Solved!

I found that on xp the program was creating a new key in HKEY_LOCAL_MACHINE - so its a different key and one that requires admin privileges to be changed. To solve the problem I set the registration data to : "HKEY_CURRENT_USER\Software\EzySoft\InstInvCashBk\Info" - somehow this works.
It would be useful to know if this can be done with other software and how one might otherwise account for such differences in OS's?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
Product-specific

I expect that it uses HKCU and then falls back on HKLM. So if you installed it, it may have set itself up in HKLM. The way in which something may use HKCU or HKLM or some combination is entirely product-specific; there's no real way of predicting what it'll do.

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

alysher
Offline
Last seen: 6 years 6 months ago
Joined: 2010-10-28 13:47
Just to make sure...

if im understanding you right i need a seperate .reg file for each of:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\appname\Path: "application"
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\appname\DisplayName: "appname"
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\HijackThis\UninstallString: "C:\Documents and Settings\Alysher\Desktop\appname\appname.exe /uninstall"
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\appname\DisplayIcon: "appname/location.exe"
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\appname\DisplayVersion: "number"
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\appname\Publisher: "company"
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\appname\URLInfoAbout: "URL"

ie for each data value...

or do i just need a .reg for each main area

ie:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\appname
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\appname

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

With the possible (but not likely) exception of the first one, these are all from the installer and so you should ignore them. Try running the app on a clean machine (meaning, without the installer) and see if it creates them.

However, to answer your question, [RegistryKeys] is for registry keys - not individual values. If you don't understand all the terminology, read up about it - Wikipedia's a good place. It's a good idea to understand something before trying to use 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

alysher
Offline
Last seen: 6 years 6 months ago
Joined: 2010-10-28 13:47
just a mix up

i was just confused about what was a key and what was a value.

and as for running the app on a clean machine with out an installer, i had done that and those keys showed up(as well as a bunch of settings for said program), so i assume i have to put them in and remove with the launcher...correct?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 10 months ago
Joined: 2007-04-15 21:08
Self-installing

That is interesting. Self-installing. Does it then require administrator privileges? Try running it with /uninstall afterwards and see what happens.

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

alysher
Offline
Last seen: 6 years 6 months ago
Joined: 2010-10-28 13:47
if you think that was interesting...

yes it is interesting, and to make matters even better the program has a button in the options to uninstall and exit the program. ill check on the /uninstall switch, but i dont think it will do much....

*EDIT*
Ok, the uninstall switch activates the uninstall button in the program, but the program itself wont run....

*edit2*
forgot to answer your question about admin privledges...and yes it does, its a program that can remove malware and hijack attemps through the registry, so it has to have admin privledges

Log in or register to post comments