Indigo Rose Software

Go Back   Indigo Rose Software Forums > Setup Factory 8.0 > Setup Factory 8.0 Suggestions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-17-2008
SetupJuggler SetupJuggler is offline
Indigo Rose Customer
 
Join Date: Nov 2008
Location: Göttingen, Germany
Posts: 62
Uninstall registry w. UninstallData does not work

I'm Using SUF 8.1.1006.0

I used the example from http://www.indigorose.com/forums/sho...=UninstallData to create my uninstall within <On Post Install> action. If I examine my Setup the registry entry is added to the registry, but on uninstall I got the error 1601.

Code:
Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\_Company\\Product\\logging", "logfile", "C:\\logbook\\automated\\log.txt", REG_SZ);
-- Now update the uninstall so that the above registry value get deleted
sItemData = {ID="UISCRIPT_001", Timing=4, Script="Registry.DeleteKey(HKEY_LOCAL_MACHINE, \"SOFTWARE\\_Company\\Product\\logging\");"};
UninstallData.AddItem(UNINDATA_SCRIPTS, sItemData);
The Uninstall logfile shows
...
[11/17/2008 16:47:47] Error Script: Extra Script: UISCRIPT_001, Line 1 (1601)
[11/17/2008 16:47:47] Success Run extra uninstall script: 4
...

The example project and the log files are attached.

Any idea what's wrong.
Attached Files
File Type: zip Bug_RegistryUninstall.zip (11.8 KB, 3 views)
Reply With Quote
  #2  
Old 11-19-2008
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
Ok, here is what I did:
  1. I created a script file named "uninstall.lua", containing the code below, and included it under Resources > Scripts.
    Code:
    function cleanup() 
    	-- remove just the "logfile" value
    	Dialog.Message("deleting value", SessionVar.Expand("SOFTWARE\\%CompanyName%\\%ProductName%\\logging"), MB_OK);
    	Registry.DeleteValue(HKEY_LOCAL_MACHINE, SessionVar.Expand("SOFTWARE\\%CompanyName%\\%ProductName%\\logging"), "logfile");
    	
    	-- remove the whole "%ProductName%" key
    	Dialog.Message("deleting key", SessionVar.Expand("SOFTWARE\\%CompanyName%\\%ProductName%"), MB_OK);
    	Registry.DeleteKey(HKEY_LOCAL_MACHINE, SessionVar.Expand("SOFTWARE\\%CompanyName%\\%ProductName%"));
    end
  2. In On Post Install I placed the following code:
    Code:
    Registry.SetValue(HKEY_LOCAL_MACHINE, SessionVar.Expand("SOFTWARE\\%CompanyName%\\%ProductName%\\logging"), "logfile", SessionVar.Expand("%AppFolder%\\logbook\\automated\\log.txt"), REG_SZ);
    
    -- Now update the uninstall so that the above registry value get deleted
    sItemData = {ID="myscript", Timing=4, Script="cleanup();"};
    UninstallData.AddItem(UNINDATA_SCRIPTS, sItemData);
  3. When uninstalling, you will get two dialogs for debugging purposes. Once everything works as it should, comment them out or remove them. The removal of the key will remove the value as well, of course, so the first step isn't really required but included for demonstration only.

Ulrich
__________________
Reply With Quote
  #3  
Old 11-20-2008
SetupJuggler SetupJuggler is offline
Indigo Rose Customer
 
Join Date: Nov 2008
Location: Göttingen, Germany
Posts: 62
Smile

Thanks, Ulrich.

Tried it out and worked fine. That's it.
But I have to handle round about 50 registry entries, so I won't create a lot of special lua-function. So I tried the cleanup() function with parameters. And oops the parameter string lost its backslashes. that's the real bug. So I have to try why my string "Software\\_Company\\Product" went to "Software_CompanyProduct".

Any idea? More backslashes? Or is it such a hard bug, no workaround exists.
Reply With Quote
  #4  
Old 11-21-2008
SetupJuggler SetupJuggler is offline
Indigo Rose Customer
 
Join Date: Nov 2008
Location: Göttingen, Germany
Posts: 62
Thumbs up Get it! Dublicate the double bakslash!

Hi Ulrich,
your cleanup script inspires me Thank's a lot.
Tried it with dublicated quotes, and oh suprise, that works fine.

Code:
Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\_Company\\Product\\logging", "logfile", "C:\\logbook\\automated\\log.txt", REG_SZ);
-- Now update the uninstall so that the above registry value get deleted
-- 4 backslashes needed within script command string to work fine
sItemData = {ID="UISCRIPT_001", Timing=4, Script="Registry.DeleteKey(HKEY_LOCAL_MACHINE, \"SOFTWARE\\\\_Company\\\\Product\\\\logging\");"};
UninstallData.AddItem(UNINDATA_SCRIPTS, sItemData);
Now I may solve my task with my 50 registry entries. Some of them have to be expanded during install, some of them have to be left after uninstall.

Udo
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My problem is how i uninstall registry , really it make me sick melissa Setup Factory 7.0 Discussion 2 05-18-2007 07:35 AM
Uninstall registry settings David Wellman Setup Factory 7.0 Discussion 9 04-11-2007 08:02 AM
Uninstall Data – Questions and Bugs (?) csd214 Setup Factory 7.0 Discussion 5 06-21-2005 12:05 PM
UninstallData to Uninstall Existing Folders kraigyb Setup Factory 7.0 Discussion 2 11-23-2004 09:07 AM
HOWTO: Include Uninstall Support Support Setup Factory 6.0 Knowledge Base 0 09-26-2002 03:33 PM


All times are GMT -6. The time now is 03:04 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software