Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set windows uninstall application icon?DispalyIcon invalid #1550

Closed
hengkx opened this issue May 16, 2017 · 10 comments · May be fixed by qcif/data-curator#563
Closed

how to set windows uninstall application icon?DispalyIcon invalid #1550

hengkx opened this issue May 16, 2017 · 10 comments · May be fixed by qcif/data-curator#563

Comments

@hengkx
Copy link

hengkx commented May 16, 2017

how to set windows uninstall application icon?
I need custom path icon。
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" "DisplayIcon" "$INSTDIR\uninstall.ico,0"don't use.

@hengkx
Copy link
Author

hengkx commented May 16, 2017

`
var startMenuLinkUnInstall

!macro setUninstallLinkVars
!ifdef MENU_FILENAME
StrCpy $startMenuLinkUnInstall "$SMPROGRAMS${MENU_FILENAME}\Uninstall ${PRODUCT_FILENAME}.lnk"
!else
StrCpy $startMenuLinkUnInstall "$SMPROGRAMS\Uninstall ${PRODUCT_FILENAME}.lnk"
!endif
!macroend

!macro customHeader

!macroend

!macro preInit

!macroend

!macro customInit
!insertmacro setUninstallLinkVars
!macroend

!macro customInstall
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" HelpLink "http://"
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" URLUpdateInfo "http://"
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" URLInfoAbout "http://"
; WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" "DisplayIcon" "$INSTDIR\uninstall.ico,0"

CreateShortCut "$startMenuLinkUnInstall" "$INSTDIR${UNINSTALL_FILENAME}" "" "$INSTDIR${UNINSTALL_FILENAME}" 0 "" "" ""
!macroend

!macro customUnInit
!insertmacro setUninstallLinkVars
!macroend

!macro customUnInstall
WinShell::UninstShortcut "$startMenuLinkUnInstall"
Delete "$startMenuLinkUnInstall"
!macroend
`

@hengkx hengkx changed the title how to set windows uninstall application icon? how to set windows uninstall application icon?DispalyIcon invalid May 16, 2017
@develar
Copy link
Member

develar commented May 21, 2017

uninstallerIcon options was added to nsis. Defaults to uninstallerIcon.ico.

@hengkx
Copy link
Author

hengkx commented May 21, 2017

@develar Thanks,I set it this way;
"nsis": { "oneClick": true, "perMachine": true, "include": "build/installer.nsh", "uninstallerIcon": "uninstallerIcon.ico" },
uninstall application icon invalid

@develar
Copy link
Member

develar commented May 21, 2017

Do you use latest version? Did you remove your custom code? Where icon is invalid and how?

@hengkx
Copy link
Author

hengkx commented May 22, 2017

@develar
1.I use version 17.10.0
2.I use electron version 1.6.8
3.I removed code
4.
c

@develar
Copy link
Member

develar commented May 22, 2017

Just put uninstallerIcon.ico to build dir and nothing more. ExtraResources not required.

@hengkx
Copy link
Author

hengkx commented May 22, 2017

@develar Still not in use,"nsis": { "oneClick": true, "perMachine": true, "include": "build/installer.nsh", },

@hengkx
Copy link
Author

hengkx commented May 22, 2017

build/installer.nsh
`var startMenuLinkUnInstall

!macro setUninstallLinkVars
!ifdef MENU_FILENAME
StrCpy $startMenuLinkUnInstall "$SMPROGRAMS${MENU_FILENAME}\Uninstall ${PRODUCT_FILENAME}.lnk"
!else
StrCpy $startMenuLinkUnInstall "$SMPROGRAMS\Uninstall ${PRODUCT_FILENAME}.lnk"
!endif
!macroend

!macro customHeader

!macroend

!macro preInit

!macroend

!macro customInit
!insertmacro setUninstallLinkVars
!macroend

!macro customInstall
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" HelpLink "http://www..com"
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" URLUpdateInfo "http://www..com"
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" URLInfoAbout "http://www..com"
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" URLInfoAbout "http://www..com"
WriteRegStr SHCTX "${UNINSTALL_REGISTRY_KEY}" Comments "addon"

CreateShortCut "$startMenuLinkUnInstall" "$INSTDIR${UNINSTALL_FILENAME}" "" "$INSTDIR${UNINSTALL_FILENAME}" 0 "" "" ""

WriteRegStr HKCU "SOFTWARE\Classes\directory\shell${PRODUCT_FILENAME}" "" "Open With ${PRODUCT_FILENAME}"
WriteRegStr HKCU "SOFTWARE\Classes\directory\shell${PRODUCT_FILENAME}" "Icon" "$"$appExe$""
WriteRegStr HKCU "SOFTWARE\Classes\directory\shell${PRODUCT_FILENAME}\command" "" "$"$appExe$" " ""
WriteRegStr HKCU "SOFTWARE\Classes\directory\background\shell${PRODUCT_FILENAME}" "" "Open With ${PRODUCT_FILENAME}"
WriteRegStr HKCU "SOFTWARE\Classes\directory\background\shell${PRODUCT_FILENAME}" "Icon" "$"$appExe$""
WriteRegStr HKCU "SOFTWARE\Classes\directory\background\shell${PRODUCT_FILENAME}\command" "" "$"$appExe$" " ""
!macroend

!macro customUnInit
!insertmacro setUninstallLinkVars
!macroend

!macro customUnInstall
WinShell::UninstShortcut "$startMenuLinkUnInstall"
Delete "$startMenuLinkUnInstall"

DeleteRegKey HKCU "SOFTWARE\Classes\directory\shell\${PRODUCT_FILENAME}"
DeleteRegKey HKCU "SOFTWARE\Classes\directory\background\shell\${PRODUCT_FILENAME}"

!macroend
`

@hengkx
Copy link
Author

hengkx commented May 22, 2017

image

@hengkx
Copy link
Author

hengkx commented May 26, 2017

@develar
The icon I saw in the uninstall panel was correct, but the uninstall application(exe) icon was not wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants