Skip to content

Commit f72b6ff

Browse files
gonwanu-235
authored andcommitted
Display app info in windows 11 installed apps and control panel.
1 parent 2f2a003 commit f72b6ff

2 files changed

Lines changed: 29 additions & 9 deletions

File tree

packages/build-win-msys2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ package()
7676

7777
makensis \
7878
-DAPP_ARCH="$PACKAGE_ARCH" \
79+
-DAPP_VERSION="$PACKAGE_VERSION" \
7980
-DINSTALLER_FILE="${OLD_PWD}/${PACKAGE_FILE_NAME}".exe \
8081
"${PACKAGE_DIR}"/win-installer.nsi
8182
rm "${PACKAGE_DIR}"/win-installer.nsi

packages/win-installer.nsi

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,6 @@ Section "-Install"
106106
SetOutPath "$INSTDIR\${PKG_ICONS_DIR}"
107107
File /r "${APP_ICONS_DIR}\*.ico"
108108

109-
;Store installation folder
110-
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\uChmViewer" "" "$INSTDIR"
111-
112-
;Create uninstaller
113-
WriteUninstaller "$INSTDIR\uninst.exe"
114-
115109
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
116110
;Create shortcuts
117111
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
@@ -128,9 +122,6 @@ Section "Uninstall"
128122
RMDir "$SMPROGRAMS\$R0"
129123
Pop $R0
130124

131-
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\uChmViewer"
132-
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\uChmViewer"
133-
134125
Delete "$INSTDIR\${PKG_ICONS_DIR}\*.ico"
135126
Delete "$INSTDIR\${PKG_BIN_DIR}\uChmViewer.exe"
136127
Delete "$INSTDIR\LICENSE.txt"
@@ -225,3 +216,31 @@ Section "un.File type association"
225216
!insertmacro UPDATEFILEASSOC
226217
SectionEnd
227218

219+
220+
;==============================;
221+
; Uninstall info ;
222+
;==============================;
223+
224+
!define PRODUCT_DIR_REGKEY "Software\uChmViewer"
225+
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\uChmViewer"
226+
227+
Section "-Uninstall info"
228+
WriteUninstaller "$INSTDIR\uninst.exe"
229+
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
230+
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${APP_VERSION}"
231+
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\${PKG_BIN_DIR}\uChmViewer.exe"
232+
233+
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
234+
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PKG_BIN_DIR}\uChmViewer.exe,0"
235+
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${APP_VERSION}"
236+
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
237+
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "UninstallString" "$\"$INSTDIR\uninst.exe$\""
238+
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "https://github.com/eBookProjects/uChmViewer"
239+
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "Publisher" "eBookProjects"
240+
SectionEnd
241+
242+
Section "un.Uninstall info"
243+
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
244+
DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}"
245+
SectionEnd
246+

0 commit comments

Comments
 (0)