Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Removing Registry


8 replies to this topic

pajaykumar

pajaykumar
  • Full Members
  • 33 posts

Posted 10 May 2007 - 16:26

Hello Everybody,

Our application makes an entry in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run.

During Uninstallation of my application, this entry does not get removed.

My problem is how can I remove this? And if a use a script, which function should I use and where should I place the script in execute sequence.

Thanks,

Ajaykumar

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 10 May 2007 - 16:34

Generate a log to see why it's not getting removed.
Make sure the uninstall runs in the same user context as the install.

pajaykumar

pajaykumar
  • Full Members
  • 33 posts

Posted 10 May 2007 - 16:45

Thanks Stefan, for your quick reply.

But what I know is, InstallShield removes only the thing which it adds. And this registry is added by our program, not by InstallShield during installation . Please correct me; I don’t know much about this.

Thanks,

Ajay

pajaykumar

pajaykumar
  • Full Members
  • 33 posts

Posted 14 May 2007 - 16:08

Can I do this by using removeregistry property

haroldxious

haroldxious
  • Full Members
  • 70 posts

Posted 15 May 2007 - 08:32

try this

szKey = "Software\\...\\...;
nvType = REGDB_STRING;
svValue = "";
nvSize = 0;

nRootKey = HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE;
if( RegDBSetDefaultRoot (nRootKey) < 0 ) then
MessageBox ("cannot change default value", SEVERE);
endif;

szName = "Name of the key in registry";
if( RegDBDeleteValue ( szKey , szName ) < 0 ) then
MessageBox (svValue, SEVERE);
endif;


Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 15 May 2007 - 10:02

Keys added per user are generally not cleaned on uninstall since they essentially constitute user data. In this case the per user entry is not even added by the setup, but by the application - as such it is not really a setup task to clean it.

However, if multiple users have launched your application this cleanup would need to happen once per user. There is a way to achieve this: using ActiveSetup and a cleanup script in whatever format you want (cmd, bat, vbs, exe etc...).

1: Create a cleanup script in the format you require.
2: Update the attached registry file with the path to the cleanup file, then write it to the registry.
3: Log in as different users, the cleanup script should run once for each user.

Attached Files


Regards
-Stein Åsmul

pajaykumar

pajaykumar
  • Full Members
  • 33 posts

Posted 18 May 2007 - 06:43

Thanks a lot,

I got many new things from this, but still running with some issues.

I have written one script to remove this registry, also I can use one which is given by haroldxious, but where should I place it in install execute sequence?

And one more question, can’t I use remove registry property from property table, to remove this entry from run.

Thanks,

Ajay

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 18 May 2007 - 07:10

RemoveRegistry would work for the user uninstalling the product, but not for the next user when they log on next time. This is why ActiveSetup is needed in the first place: it is guaranteed to run once per user.
Regards
-Stein Åsmul

pajaykumar

pajaykumar
  • Full Members
  • 33 posts

Posted 18 May 2007 - 08:26

Thanks Glytzhkof,

But Our application works only for one user and we dont have all users property on. I want to remove it only for one user.