Skip to content

Commit

Permalink
Windows GUI: Installer improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
cjee21 committed Nov 16, 2024
1 parent 165c27c commit d298b47
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 12 deletions.
27 changes: 23 additions & 4 deletions Source/Install/MediaInfo_GUI_Windows.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Section -Post
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\MediaInfo.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
Exec 'regsvr32 "$INSTDIR\MediaInfo_InfoTip.dll" /s'
ExecWait '"$SYSDIR\regsvr32.exe" "$INSTDIR\MediaInfo_InfoTip.dll" /s'

${If} ${AtLeastWin11}
!insertmacro MediaInfo_Extensions_Uninstall
Expand All @@ -207,14 +207,23 @@ Section -Post
IntFmt $0 "0x%08X" $0 ; Convert the decimal KB value in $0 to DWORD, put it right back into $0
WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "EstimatedSize" "$0" ; Create/Write the reg key with the dword value
${EndIf}

; Refresh File Explorer
!ifndef SHCNE_ASSOCCHANGED
!define SHCNE_ASSOCCHANGED 0x08000000
!endif
!ifndef SHCNF_IDLIST
!define SHCNF_IDLIST 0x0000
!endif
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'

SectionEnd


Section Uninstall
SetRegView 64
!insertmacro MediaInfo_Extensions_Uninstall
Exec 'regsvr32 "$INSTDIR\MediaInfo_InfoTip.dll" /u /s'
Sleep 3000
ExecWait '"$SYSDIR\regsvr32.exe" "$INSTDIR\MediaInfo_InfoTip.dll" /u /s'

IfFileExists "$INSTDIR\graph_plugin_uninst.exe" 0 +3
ExecWait '"$INSTDIR\graph_plugin_uninst.exe" /S _?=$INSTDIR'
Expand All @@ -237,10 +246,10 @@ Section Uninstall
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo.exe"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo.dll"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo_i386.dll"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo_InfoTip.dll"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\WebView2Loader.dll"
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\MediaInfo_InfoTip.dll"
Delete "$INSTDIR\History.txt"
Delete "$INSTDIR\License.html"
Delete "$INSTDIR\License.NoModifications.html"
Expand Down Expand Up @@ -279,4 +288,14 @@ Section Uninstall
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true

; Refresh File Explorer
!ifndef SHCNE_ASSOCCHANGED
!define SHCNE_ASSOCCHANGED 0x08000000
!endif
!ifndef SHCNF_IDLIST
!define SHCNF_IDLIST 0x0000
!endif
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'

SectionEnd
27 changes: 23 additions & 4 deletions Source/Install/MediaInfo_GUI_Windows_i386.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,30 @@ Section -Post
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\MediaInfo.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
Exec 'regsvr32 "$INSTDIR\MediaInfo_InfoTip.dll" /s'
ExecWait '"$SYSDIR\regsvr32.exe" "$INSTDIR\MediaInfo_InfoTip.dll" /s'
!insertmacro MediaInfo_Extensions_Install

${If} ${AtLeastWin7}
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0 ; Convert the decimal KB value in $0 to DWORD, put it right back into $0
WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "EstimatedSize" "$0" ; Create/Write the reg key with the dword value
${EndIf}

; Refresh File Explorer
!ifndef SHCNE_ASSOCCHANGED
!define SHCNE_ASSOCCHANGED 0x08000000
!endif
!ifndef SHCNF_IDLIST
!define SHCNF_IDLIST 0x0000
!endif
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'

SectionEnd


Section Uninstall
!insertmacro MediaInfo_Extensions_Uninstall
Exec 'regsvr32 "$INSTDIR\MediaInfo_InfoTip.dll" /u /s'
Sleep 3000
ExecWait '"$SYSDIR\regsvr32.exe" "$INSTDIR\MediaInfo_InfoTip.dll" /u /s'

IfFileExists "$INSTDIR\graph_plugin_uninst.exe" 0 +3
ExecWait '"$INSTDIR\graph_plugin_uninst.exe" /S _?=$INSTDIR'
Expand All @@ -198,10 +207,10 @@ Section Uninstall
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo.exe"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo.dll"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo_i386.dll"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo_InfoTip.dll"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\WebView2Loader.dll"
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\MediaInfo_InfoTip.dll"
Delete "$INSTDIR\History.txt"
Delete "$INSTDIR\License.html"
Delete "$INSTDIR\License.NoModifications.html"
Expand Down Expand Up @@ -239,4 +248,14 @@ Section Uninstall
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true

; Refresh File Explorer
!ifndef SHCNE_ASSOCCHANGED
!define SHCNE_ASSOCCHANGED 0x08000000
!endif
!ifndef SHCNF_IDLIST
!define SHCNF_IDLIST 0x0000
!endif
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'

SectionEnd
27 changes: 23 additions & 4 deletions Source/Install/MediaInfo_GUI_Windows_x64.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Section -Post
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\MediaInfo.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
Exec 'regsvr32 "$INSTDIR\MediaInfo_InfoTip.dll" /s'
ExecWait '"$SYSDIR\regsvr32.exe" "$INSTDIR\MediaInfo_InfoTip.dll" /s'

${If} ${AtLeastWin11}
!insertmacro MediaInfo_Extensions_Uninstall
Expand All @@ -202,14 +202,23 @@ Section -Post
IntFmt $0 "0x%08X" $0 ; Convert the decimal KB value in $0 to DWORD, put it right back into $0
WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "EstimatedSize" "$0" ; Create/Write the reg key with the dword value
${EndIf}

; Refresh File Explorer
!ifndef SHCNE_ASSOCCHANGED
!define SHCNE_ASSOCCHANGED 0x08000000
!endif
!ifndef SHCNF_IDLIST
!define SHCNF_IDLIST 0x0000
!endif
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'

SectionEnd


Section Uninstall
SetRegView 64
!insertmacro MediaInfo_Extensions_Uninstall
Exec 'regsvr32 "$INSTDIR\MediaInfo_InfoTip.dll" /u /s'
Sleep 3000
ExecWait '"$SYSDIR\regsvr32.exe" "$INSTDIR\MediaInfo_InfoTip.dll" /u /s'

IfFileExists "$INSTDIR\graph_plugin_uninst.exe" 0 +3
ExecWait '"$INSTDIR\graph_plugin_uninst.exe" /S _?=$INSTDIR'
Expand All @@ -232,10 +241,10 @@ Section Uninstall
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo.exe"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo.dll"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo_i386.dll"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\MediaInfo_InfoTip.dll"
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\WebView2Loader.dll"
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\MediaInfo_InfoTip.dll"
Delete "$INSTDIR\History.txt"
Delete "$INSTDIR\License.html"
Delete "$INSTDIR\License.NoModifications.html"
Expand Down Expand Up @@ -274,4 +283,14 @@ Section Uninstall
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true

; Refresh File Explorer
!ifndef SHCNE_ASSOCCHANGED
!define SHCNE_ASSOCCHANGED 0x08000000
!endif
!ifndef SHCNF_IDLIST
!define SHCNF_IDLIST 0x0000
!endif
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'

SectionEnd

0 comments on commit d298b47

Please sign in to comment.