You are here

NSIS registry backup question

3 posts / 0 new
Last post
prapper
Offline
Last seen: 3 years 10 months ago
Developer
Joined: 2008-01-24 17:01
NSIS registry backup question

OK, nOOb here, go easy... Smile

I've written a few launchers by modifying the 7-Zip code (as suggested for programs that just use the registry) and everything works great but I've run into a problem with local installs and portables from the same company existing together.

An example...

HKCU\Software\Company\Program1 (local install)
HKCU\Software\Company\Program2 (portable)

When Program2Portable is launched it renames "Company" to "Company-BackupByProgram2Portable", thereby temporarily removing the entries for locally installed Program1.

The solution I used is to target the "Program" key instead. So far, no problem. But if there was originally no "Company" key (no locally installed Program1) then, when Program2Portable exits, I'm left with a redundant registry key - HKCU\Software\Company.

When the launcher closes is there a way for it to (after it's dealt with the Program key) check the "Company" key and remove it if it's empty?

Is there a launcher I could look at that does this?

Ph4n70m
Ph4n70m's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2007-01-12 19:22
You can use a simple command

You can use a simple command
DeleteRegKey /ifempty HKCU "Software\Company"
Pardon

prapper
Offline
Last seen: 3 years 10 months ago
Developer
Joined: 2008-01-24 17:01
Thanks very much, straight to

Thanks very much, straight to the point. And all working Smile

Log in or register to post comments