Olibara
1st November 2011 08:35 UTC
sortcut on desktop not removed
Hello
I've made a installer script
The install works fine
Uninstall too
However the shortcut created on the desktop is not removed (even on an XP machine)
Here is the uninstall section
Section Uninstall
SetShellVarContext all
Delete "$INSTDIR\uninst.exe"
;Desktop
Delete "$DESKTOP\Kairo.lnk"
;Installation directory
Delete "$INSTDIR\Kairo.url"
Delete "$INSTDIR\Kairo.lnk"
Delete "$INSTDIR\Kairo-website.url"
RMDir /r "$INSTDIR"
;Start Menu
Delete "$SMPROGRAMS\Kairo\Kairo.lnk"
Delete "$SMPROGRAMS\Kairo\Uninstall.lnk"
Delete "$SMPROGRAMS\Kairo\Kairo-website.lnk"
RMDir "$SMPROGRAMS\Kairo"
DeleteRegKey HKLM "Software\Kairo"
${un.registerExtension} ".grb" "Grib_Files"
${un.registerExtension} ".grb2" "Grib2_Files"
SetAutoClose true
SectionEnd
What can be wrong ?
Thanks for any help
MSG
1st November 2011 10:13 UTC
Either the path is incorrect (shellvar context?), or you don't have permissions (admin access), or the file is in use and locked (not very likely in this case).
Olibara
1st November 2011 10:50 UTC
Thank for your Help you MSG
Either the path is incorrect (shellvar context?)
I use exactly the same path and ShellVar as during install
Section -AdditionalIcons
SetShellVarContext all
WriteIniStr "$INSTDIR\${PRODUCT_NAME}-website.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateDirectory "$SMPROGRAMS\Kairo"
CreateShortCut "$SMPROGRAMS\Kairo\Kairo.lnk" ${PRODUCT_EXE_FILE_PATH}
CreateShortCut "$SMPROGRAMS\Kairo\Kairo-website.lnk" "$INSTDIR\${PRODUCT_NAME}-website.url"
CreateShortCut "$SMPROGRAMS\Kairo\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
or you don't have permissions (admin access)
I don't think so it is on my XP developper machine and I have full rightsor the file is in use and locked
No everithing is closed when I run uninstall and I can delete it manually anywayMSG
1st November 2011 11:03 UTC
Well in that code you pasted I see no desktop icon being created. I can imagine the shellvar context maybe changed before the code to create the desktop shortcut is executed?
Olibara
1st November 2011 11:41 UTC
Oups !
You are right : the desktop link is in another section maybe I have to move it or set ShellVarContext in the section below ??
Section "App Folders"
SetOverwrite ifnewer
;Include the entire Frontend directory
SetOutPath "$INSTDIR"
File /r "${LICENSE_PATH}"
SetOutPath "$INSTDIR\gdal_test\"
File /r /x *.svn "${PROJECT_FOLDER}\gdal_test\"
SetOutPath "$INSTDIR\data\"
File /r /x *.svn /x templates /x test-grib "${PROJECT_FOLDER}\data\"
SetOutPath "$INSTDIR\Resources\"
File /r /x *.svn "${PROJECT_FOLDER}\Resources\"
SetOutPath "$INSTDIR\Tools\"
File /r /x *.svn "${PROJECT_FOLDER}\Tools\"
SetOutPath "$INSTDIR\bin\"
File /r /x *.svn /x *.pdb /x *.vshost.exe /x *.manifest /x *.config "${PROJECT_FOLDER}\bin\x86\Release\"
;!!! le backslash final est indispensable pour ne pas recreer un Release sous bin
CreateShortcut "$INSTDIR\Kairo.lnk" ${PRODUCT_EXE_FILE_PATH}
CreateShortCut "$DESKTOP\Kairo.lnk" ${PRODUCT_EXE_FILE_PATH}
${registerExtension} "$INSTDIR\bin\Kairo.exe" ".grb" "Grib_Files"
${registerExtension} "$INSTDIR\bin\Kairo.exe" ".grb2" "Grib2_Files"
SectionEnd
MSG
1st November 2011 13:37 UTC
Default context is current, so yeah. http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.7.7
Olibara
1st November 2011 13:57 UTC
Thank you very much
Your help was usefull !
It is working now !