Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 29th May 2001, 00:05   #1
Aarif
Junior Member
 
Join Date: May 2001
Posts: 11
Hi there,

I want to be able to do upgrades gracefully. During the first installation, there are third party drivers I install that I do not want to install on upgrades. Also, files may have been added or removed from the original installation which I would want to synchronize with every upgrade. I have tried to use the existance if the registry key to trigger an uninstall, but for some reason it doesn't execute. I can't think of any other way.

Any suggestion or sample code would be greatly appreciated.

Aarif
Aarif is offline   Reply With Quote
Old 29th May 2001, 04:32   #2
yazno
Member
 
Join Date: Oct 2000
Posts: 92
Send a message via ICQ to yazno
hi,

well, i would do it like you described it.

1. you could write something to the registry (WriteRegStr) during the first install, so you can check for existance (ReadRegStr) and don't have to install the drivers again.

2. to check for files you could use the 'IfFileExists'
command.

i don't know why your registry routine didn't work, so maybe you should post some parts of your script.

cu yzo
yazno is offline   Reply With Quote
Old 29th May 2001, 16:17   #3
Aarif
Junior Member
 
Join Date: May 2001
Posts: 11
This is the code I place at the top of the section, before te "File" commands.

ClearErrors
ReadRegStr $1 HKLM "SOFTWARE\Cavio Corporation\Cavio" ""
IfErrors lbl_nouninstall

ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cavio" "UninstallString"

ExecWait "$1"

lbl_nouninstall:

I see the log file showing the execution of the uninstall, but it never actually executes.

Aarif
Aarif is offline   Reply With Quote
Old 29th May 2001, 21:54   #4
yazno
Member
 
Join Date: Oct 2000
Posts: 92
Send a message via ICQ to yazno
hi,

that looks like it should work, but you could debug it a lil' more, so you have more chances to find the failure.

try it like that:

ClearErrors
ReadRegStr $1 HKLM "SOFTWARE\Cavio Corporation\Cavio" ""
IfErrors lbl_nouninstall

ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cavio" "UninstallString"
IfErrors lbl_nouninstall

ExecWait "$1" ; <-- maybe you should replace "" with ''
; i don't know what happens
; when $1 returns this: ""longpathname/filename.exe" /param"
; so maybe: '"longpathname/filename.exe" /param' would work
; better
IfErrors lbl_error lbl_nouninstall

lbl_error:
MessageBox MB_OK 'Error: $1' ; only for debuging

lbl_nouninstall:

cu yzo
yazno is offline   Reply With Quote
Old 30th May 2001, 16:33   #5
Aarif
Junior Member
 
Join Date: May 2001
Posts: 11
Thanks yazno, your assistance helped.

For some reason, I had to issue a "SetOutPath "$INSTDIR"" before the "ExecWait...". Now, the problem I am having is that it is not waiting for the uninstall to complete. As if I were using just "Exec" instead of "ExecWait".

Any suggestions? Is anyone trying to do the same thing?

Aarif
Aarif is offline   Reply With Quote
Reply
Go Back   Winamp 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