Archive: Add/Remove not initialising uninstaller?


Add/Remove not initialising uninstaller?
Ehm.. I thought that using add/remove would initialise the uninstaller, but it didnt, instead it simply removed the program entry there. Is there a link I can perhaps read, or might someone know why this happens?

Thanks if any help ;]


Sounds like your uninstaller path is set wrong in the registry.

Stu


Thanks for reply :]

This is what I have:

!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\DracoSSC.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"


and:

Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\DracoSSC.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\DracoSSC.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd


Please could you perhaps offer how this could be wrong?

What about the uninstall section?


After that last section, only this remains:

Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd

Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd

Section Uninstall
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$WINDIR\System\TestFolder1\stdole2.tlb"
Delete "$WINDIR\System\TestFolder1\olepro32.dll"
Delete "$WINDIR\System\TestFolder1\oleaut32.dll"
Delete "$WINDIR\System\TestFolder1\msvbvm60.dll"
Delete "$WINDIR\System\TestFolder1\COMCAT.DLL"
Delete "$WINDIR\System\TestFolder1\asycfilt.dll"
Delete "$WINDIR\System\TestFolder1\scrrun.dll"
Delete "$WINDIR\System\TestFolder1\richtx32.ocx"
Delete "$WINDIR\System\TestFolder1\msvcr71.dll"
Delete "$WINDIR\System\TestFolder1\MSMASK32.OCX"
Delete "$WINDIR\System\TestFolder1\MSMAPI32.OCX"
Delete "$WINDIR\System\TestFolder1\MSINET.OCX"
Delete "$WINDIR\System\TestFolder1\MSHFLXGD.OCX"
Delete "$WINDIR\System\TestFolder1\MSFLXGRD.OCX"
Delete "$WINDIR\System\TestFolder1\MSCOMCTL.OCX"
Delete "$WINDIR\System\TestFolder1\MSCOMCT2.OCX"
Delete "$WINDIR\System\TestFolder1\msado25.tlb"
Delete "$WINDIR\System\TestFolder1\hhctrl.ocx"
Delete "$WINDIR\System\TestFolder1\FM20.DLL"
Delete "$WINDIR\System\TestFolder1\COMDLG32.OCX"
Delete "$WINDIR\System\TestFolder1\COMCT332.OCX"
Delete "$WINDIR\System\TestFolder1\myodbc3S.lib"
Delete "$WINDIR\System\TestFolder1\myodbc3S.dll"
Delete "$WINDIR\System\TestFolder1\myodbc3m.exe"
Delete "$WINDIR\System\TestFolder1\myodbc3i.exe"
Delete "$WINDIR\System\TestFolder1\myodbc3c.exe"
Delete "$WINDIR\System\TestFolder1\myodbc3.lib"
Delete "$WINDIR\System\TestFolder1\myodbc3.hlp"
Delete "$WINDIR\System\TestFolder1\myodbc3.gid"
Delete "$WINDIR\System\TestFolder1\myodbc3.fts"
Delete "$WINDIR\System\TestFolder1\myodbc3.dll"
Delete "$INSTDIR\zip32.dll"
Delete "$INSTDIR\WinSubHook.tlb"
Delete "$INSTDIR\User Modules\_dmd syntax.txt"
Delete "$INSTDIR\Updates.txt"
Delete "$INSTDIR\UpdateInProgress.exe"
Delete "$INSTDIR\unzip32.dll"
Delete "$INSTDIR\SSubTmr6.dll"
Delete "$INSTDIR\MSDERUN.DLL"
Delete "$INSTDIR\Modules\Verifier\verifier.cmd"
Delete "$INSTDIR\Modules\TestJet.dmd"
Delete "$INSTDIR\Modules\TestJet\TestJet.exe"
Delete "$INSTDIR\Modules\DracoSSC.DDF"
Delete "$INSTDIR\Modules\CommandPrompt.dmd"
Delete "$INSTDIR\Modules\CommandPrompt\CommandPrompt.exe"
Delete "$INSTDIR\LanguageSelector.exe"
Delete "$INSTDIR\LanguageEditor.exe"
Delete "$INSTDIR\langs.dat"
Delete "$INSTDIR\KDateBox.ocx"
Delete "$INSTDIR\Images\WelcomeBitMap.bmp"
Delete "$INSTDIR\Images\update.avi"
Delete "$INSTDIR\Images\Thumbs.db"
Delete "$INSTDIR\Images\splash.jpg"
Delete "$INSTDIR\Images\pocn.jpg"
Delete "$INSTDIR\Images\po.jpg"
Delete "$INSTDIR\Images\logonbg.jpg"
Delete "$INSTDIR\Images\lockbg.jpg"
Delete "$INSTDIR\Images\Floorplan.jpg"
Delete "$INSTDIR\Images\dragon.jpg"
Delete "$INSTDIR\Images\confail.jpg"
Delete "$INSTDIR\Icons\Thumbs.db"
Delete "$INSTDIR\Icons\SupplierX.ico"
Delete "$INSTDIR\Icons\SupplierO.ico"
Delete "$INSTDIR\Icons\Supplier.ico"
Delete "$INSTDIR\Icons\StockX.ico"
Delete "$INSTDIR\Icons\StockO.ico"
Delete "$INSTDIR\Icons\Stock.ico"
Delete "$INSTDIR\Icons\QuoteX.ico"
Delete "$INSTDIR\Icons\QuoteO.ico"
Delete "$INSTDIR\Icons\Quote.ico"
Delete "$INSTDIR\Icons\OrderX.ico"
Delete "$INSTDIR\Icons\OrderO.ico"
Delete "$INSTDIR\Icons\Order.ico"
Delete "$INSTDIR\Icons\JobX.ico"
Delete "$INSTDIR\Icons\JobO.ico"
Delete "$INSTDIR\Icons\Job.ico"
Delete "$INSTDIR\Icons\Dragon.ico"
Delete "$INSTDIR\Icons\CustomerX.ico"
Delete "$INSTDIR\Icons\CustomerO.ico"
Delete "$INSTDIR\Icons\Customer.ico"
Delete "$INSTDIR\ezVidC60.ocx"
Delete "$INSTDIR\DracoUpdate.exe"
Delete "$INSTDIR\DracoSSC.exe"
Delete "$INSTDIR\dracok.dll"
Delete "$INSTDIR\Dracohelp.chm"
Delete "$INSTDIR\DAO350.DLL"

Delete "$SMPROGRAMS\$ICONS_GROUP\Website.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Help.lnk"
Delete "$DESKTOP\Draco SSC.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Draco SSC.lnk"

RMDir "$WINDIR\System\TestFolder1"
RMDir "$SMPROGRAMS\$ICONS_GROUP"
RMDir "$INSTDIR\User Modules"
RMDir "$INSTDIR\Modules\Verifier"
RMDir "$INSTDIR\Modules\TestJet"
RMDir "$INSTDIR\Modules\CommandPrompt"
RMDir "$INSTDIR\Modules"
RMDir "$INSTDIR\Images"
RMDir "$INSTDIR\Icons"
RMDir "$INSTDIR"

DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"

;Delete the user details in registry
DeleteRegValue HKCU "Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "MySQLUser"
DeleteRegValue HKCU "Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "MySQLPass"
DeleteRegValue HKCU "Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "MySQLADDR"
DeleteRegValue HKCU "Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "AutoUpdatePath"
DeleteRegValue HKCU "Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "AutoUpdateEnable"

SetAutoClose true
SectionEnd


Thanks for reply :)

It seems you've made your installer with HM editor so normally there should be not something wrong.
According to that code, you should see/react in those 2 messages boxes and what's installed should being uninstalled.
Have you tried to run the uninstaller from StartMenu shortcut or directly from $INSTDIR ?
Is it possible to exists an invalid character in $INSTDIR ?


Yes, is what I was thinking about the HM editor.

Running the actual uninst file is fine, and seems to work perfectly. I guess the registry just doesn't know where to look for the right file?


Open regedit and check out your records. I tend to assume that there's an invalid character.


Thanks for replies again,.
There doesn't seem to be any path's to be found in the registry, in the main folder that is. None that point to an uninstaller anyways. At which point does NSIS usually inform the registry about a path to an uninst.exe file?
It's not in the script directly right?

Just wondering also, is there a way to use exec with a registry file? can I just somehow use a statement like this:

'Execwait "draco.reg" $0'
?

Thanks for any helps ;D


Regarding to your script, you should find your records by opening regedit under HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}

Yes you can execute a reg file see here,

http://forums.winamp.com/showthread....hreadid=249764

http://forums.winamp.com/showthread....hreadid=281839


Thankyou! :D The uninstall string is reading the correct path! So I'll just do some tests.


Hmm.. yeah it seems to work perfectly now ._.

Ehm, would you guys happen to know the auto-updating is continually checked? The app should check registry value, and the registry value is always '1'.

Function CustomPage

!insertmacro MUI_HEADER_TEXT "$(CUSTOM_TITLE)" "$(CUSTOM_SUBTITLE)"
# Display the page.
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "Custom"

# Get the user entered values.
!insertmacro MUI_INSTALLOPTIONS_READ $Username "Custom" "Field 1" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $Password "Custom" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $Server "Custom" "Field 3" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $Autoupdate "Custom" "Field 4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $AUpdatePath "Custom" "Field 5" "State"


WriteRegStr HKCU "Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "MySQLUser" $Username ;As per install instruction file.
WriteRegStr HKCU "Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "MySQLPass" $Password
WriteRegStr HKCU "Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "MySQLADDR" $Server
WriteRegStr HKCU "Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "AutoUpdatePath" $AUpdatePath

${If} $Autoupdate = 1 ;control is selected
WriteRegStr HKCU "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "AutoUpdateEnable"="1"
${EndIf}
${If} $Autoupdate = 0
WriteRegStr HKCU "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\${PRODUCT_NAME}\Main" "AutoUpdateEnable"="0"
${EndIf}

FunctionEnd


I thought the last set of statements would work properly.. At least the reg key is actually made.. :] I can't see someone wanting to use the installer without selecting auto-update anyways..

You must get the user entered values within custom page leave function. When you read it within create function, you're just getting the values that you've set as default.