- NSIS Discussion
- Auto-uninstall old...Question
Archive: Auto-uninstall old...Question
jaschulz
15th September 2003 17:11 UTC
Auto-uninstall old...Question
This is from the "Auto-uninstall old before installing new..." script in the archive:
uninst:
ClearErrors
ExecWait '$1'
IfErrors cont ; if problems off the bat, yell again
; wait until the uninstaller is really not running anymore
uninst_wait:
Sleep 500
FindWindow $0 "" "${PROGRAM_NAME} Uninstall"
IsWindow $0 uninst_wait uninst_wait
It looks to me as if the last line is an infinte loop. Shouldn't it be:
IsWindow $0 uninst_wait ""
Thanks,
JAS
Joost Verburg
15th September 2003 18:02 UTC
Fixed that page.
jaschulz
15th September 2003 18:16 UTC
Here's the link:
http://nsis.sourceforge.net/archive/...instances=0,11
emiste7
17th September 2003 16:17 UTC
Sorry for my question.....remember im a newbie.
For this feature I need to have a INI file??
Like:
Page custom unInstall
and,
LangString TEXT_IOSTARTINSTALL_TITLE ${LANG_ENGLISH} "Updating system files"
LangString TEXT_IOSTARTINSTALL_SUBTITLE ${LANG_ENGLISH} "${MUI_PRODUCT} Uninstall previous software"
ReserveFile "ioUnInstall.ini"
!insertmacro MUI_RESERVEFILE_UNINSTALLOPTIONS
Afrow UK
17th September 2003 16:22 UTC
No, it's all in the .onInit function.
This is called before the installer loads.
-Stu
emiste7
18th September 2003 02:48 UTC
I have this error:
1 warning:
label "check" not used
Joost Verburg
18th September 2003 13:45 UTC
The is no label called check in the code. You must have added it somewhere else.
emiste7
18th September 2003 14:03 UTC
I just did a copy and paste of the script from the link to my .onInit
Function .onInit
check:
ReadRegStr $1 HKCU
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Parsimonia 2.1"
"UninstallString"
Other changed = ${PROGRAM_NAME} now they are Parsimonia 2.1
FunctionEnd
emiste7
19th September 2003 14:46 UTC
There is the "check:" in the script....autouninstall script.
If Im going to insert ";" before "check:" I dont have any error.
But doesnt work, can someone help me.
Thank you
Joost Verburg
19th September 2003 15:17 UTC
It doesn't look like the check label is being used. Did you define PROGRAM_NAME etc.?
emiste7
19th September 2003 16:11 UTC
No any more :)
!define PROD_NAME "Parsimonia"
!define PROD_VER "2.1"
emiste7
19th September 2003 16:12 UTC
Sorry I forgot my script
Joost Verburg
19th September 2003 16:23 UTC
So what is exactly the problem? The FindWindow caption detection is not that reliable. You should check that PROGRAM_NAME is defined and similar to the uninstaller window caption.
I don't think that extra check is really required.
You can also close the installer and make the uninstaller run the installer again.