Skip to content
⌘ NSIS Forum Archive

Auto-uninstall old...Question

13 posts

jaschulz#

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
jaschulz#
Here's the link:

emiste7#
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
emiste7#
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#
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#edited
It doesn't look like the check label is being used. Did you define PROGRAM_NAME etc.?
emiste7#
Sorry I forgot my script
Joost Verburg#
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.