Brummelchen
27th May 2003 21:58 UTC
Uninstaller needs Reboot option
hello out there
nice forum :)
i am reading now for some days... but i didnt found any solution - i am not firm at all with nsis
I need a reboot option on the uninstaller (like reboot option on installer)
Please give me a hint
Joel
27th May 2003 22:05 UTC
check the Docs...
"Reboot" is there :)
Joost Verburg
27th May 2003 22:16 UTC
Check the reboot flag (IfRebootFlag), display a message and use Reboot to reboot.
Brummelchen
27th May 2003 23:04 UTC
Joost
>display a message
that is one problem - i dont know how
i just captured some syntax from "if" and vars - but the MUI? Just egypt to me :/
I found similar from the system.nsh (v1.63, your work) but i can't use it - call me a dumb.
BTW. Same problem with an additional README-MUI section - never got it.
Brummelchen
28th May 2003 22:11 UTC
i found a code snippet like this:
IfRebootFlag "" noreboot
re_boot:
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 " <bla> reboot?" IDYES +2
REBOOT
Abort
noreboot:
But there is something wrong - it reboots always.
must the "abort" before or after the reboot or can i use a jump on that question - dont know how
Sunjammer
28th May 2003 22:38 UTC
Change +2 to noreboot, e.g.
re_boot:
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 " <bla> reboot?" IDYES noreboot
REBOOT
Abort
noreboot:
Brummelchen
28th May 2003 22:52 UTC
thank you very much :)
grmpblfix - did not work :(
kichik
29th May 2003 09:58 UTC
If you want it to reboot when the user clicks yes you should change IDYES to IDNO.
Brummelchen
29th May 2003 15:02 UTC
kichik
it was late today and i read again again again the manual and i changed it to IDNO and it works
not easy to a newbie
thank you
but i have a solution to my problem
; Usage:
; push dirname\dllname
; call exchange
Function exchange
Exch $R1
Push $R2
Push $R3
Push $R4
; $R1=oldname
; $R2=newname
; $R3=counter
StrCpy $R3 0
;check first if deletable
Delete $R1
IfFileExists $R1 0 copy
loop:
StrCpy $R2 $R1.$R3.tmp
IfFileExists $R2 0 done
IntOp $R3 $R3 + 1
Goto loop
done:
Rename $R1 $R2
copy:
;file was found and renamed
File "yourdll.dll"
;delete old TMP-files on next boot
Delete /REBOOTOK "$INSTDIR\*.tmp"
Pop $R3
Pop $R2
Pop $R1
FunctionEnd
another installer gave me that hint to rename that file, copy new file and delete old one on reboot.
i dont need the other script (UpgradeDLL.nsh]any longer :)
Now it is a fine peace of work i finshed a couple of minutes ago WITH your help
PS the function isnt perfect at all but it takes someone only a minute to make it 100% variable
PPS some explanation:
the file that has to be replaced will be renamed to <oldname.ext.counter.tmp>
counter goes up from "0" to anywhere but it is quite impossible that someone has done this a million times
before renaming it is controlled if that file is not there otherwise counter=counter+1 and loop
TMP-files are deleted on reboot
kichik
29th May 2003 15:07 UTC
Are you sure this code works? If you can't delete the file how come you can rename it?
Brummelchen
29th May 2003 15:11 UTC
dont ask me that - i even wondered too but it works on my dll - unfortunately i cant delete it in any case nor the folder.
as i mentioned above this is no system-dll but it is shown in the explorer context
##
damn i posted the function into the wrong topic.
must be http://forums.winamp.com/showthread....088#post971088
hey mod you can /join if you like to :)
kichik
29th May 2003 15:30 UTC
Make sure it works on every system, seems a little odd...
Is there any difference between the code in this post and the code in the other post? Looks exactly the same to me.