Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   InstallLib RunOnce fails on reboot if RegTool was deleted (http://forums.winamp.com/showthread.php?t=296508)

BuilderBob 26th August 2008 15:06

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 27th August 2008 14:39

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" 


zanz 27th August 2008 15:39

your issue seems very similar to mine. Read this thread: http://forums.winamp.com/showthread....hreadid=296139

BuilderBob 28th August 2008 07:49

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?

Joost Verburg 28th August 2008 08:40

Do you need support for Win9x?

BuilderBob 28th August 2008 11:13

- 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?


All times are GMT. The time now is 17:58.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.