Old 26th August 2008, 15:06   #1
BuilderBob
Junior Member
 
Join Date: Mar 2008
Posts: 35
InstallLib RunOnce fails on reboot if RegTool was deleted

I'm using InstallLib to register some dlls.

On XP, while upgrading, if the dll is in-use I can't rename it and install a new one (in Vista it works), so InstallLib automatically adds an entry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce so RegTool will register the dll on startup.

If user now uninstalls before rebooting, the RegTool application will be deleted since it's in the install folder. On next startup user will see an error message "Windows cannot find blablabla".

Can I make it silent in a way other than searching the RunOnce key for values with the path i'm deleting and remove it?
BuilderBob is offline   Reply With Quote
Old 27th August 2008, 14:39   #2
BuilderBob
Junior Member
 
Join Date: Mar 2008
Posts: 35
Meanwhile I deleted from registry everything that I found relevant, with this code:

PHP Code:
;Delete pending dll upgrades which are no longer relevantso no error message on XP reboot.
  
StrCpy $"NSIS.Library.RegTool.v2"
  
ReadRegStr $1 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" $0
  
${StrContains$R2 $OutDir $;Check if pending RegTool is in the folder we've just deleted.
  ${If} $R2 != ""
    DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" $0
  ${EndIf}
  ;Delete RegTool values.
  StrCpy $R0 0
  ${Do}
    EnumRegKey $0 HKLM "SOFTWARE\NSIS.Library.RegTool.v2" $R0
    ${If} $0 != ""
      ReadRegStr $1 HKLM "SOFTWARE\NSIS.Library.RegTool.v2\$0" "1.file"
      ${StrContains} $R1 $OutDir $1 ;Check for anything that'
s in the folder we've just deleted
        ${If} $R1 != ""
          DeleteRegKey HKLM "SOFTWARE\NSIS.Library.RegTool.v2\$0"
          StrCpy $R0 0
          ${Continue}
        ${EndIf}
    ${EndIf}
    IntOp $R0 $R0 + 1
  ${LoopUntil} $0 == ""
  DeleteRegKey /ifempty HKLM "SOFTWARE\NSIS.Library.RegTool.v2" 
BuilderBob is offline   Reply With Quote
Old 27th August 2008, 15:39   #3
zanz
Member
 
Join Date: Jul 2008
Posts: 59
your issue seems very similar to mine. Read this thread: http://forums.winamp.com/showthread....hreadid=296139
zanz is offline   Reply With Quote
Old 28th August 2008, 07:49   #4
BuilderBob
Junior Member
 
Join Date: Mar 2008
Posts: 35
Yes, I saw it. I don't want everything to go to $TEMP. What happens if destination is in a different drive than $TEMP?

Unfortunately, I think there's only one RegTool entry in RunOnce for all pending registrations, even those not related to your product, so by deleting this reg value I'm ruining other installations.

Maybe I should copy the regtool i'm about to delete into temp and modify the RunOnce value? Anyone?
BuilderBob is offline   Reply With Quote
Old 28th August 2008, 08:40   #5
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Do you need support for Win9x?
Joost Verburg is offline   Reply With Quote
Old 28th August 2008, 11:13   #6
BuilderBob
Junior Member
 
Join Date: Mar 2008
Posts: 35
- I support XP onwards.
- I checked, and the different drive issue is only for whole folders, so no problem there.
- If I let it use $TEMP, wouldn't dlls reappear after reboot even if the product was uninstalled?
BuilderBob is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump