Win inssaller: cleanup and support for thumbnails
- remove unused file - register DLL file to view thumbnails in Windows explorer (if the user has admin permissions) - some code simplifications
This commit is contained in:
@@ -75,9 +75,6 @@ Section -Configure
|
||||
|
||||
${if} $CreateFileAssociations == "true"
|
||||
WriteRegStr SHCTX "${APP_DIR_REGKEY}" "" "$INSTDIR\${APP_RUN}"
|
||||
${endif}
|
||||
|
||||
${if} $CreateFileAssociations == "true"
|
||||
WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}" "" "${APP_NAME} Document"
|
||||
WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}\DefaultIcon" "" "$INSTDIR\${APP_RUN},0"
|
||||
WriteRegStr SHCTX "Software\Classes\${APP_REGNAME_DOC}\Shell\open\command" "" '"$INSTDIR\${APP_RUN}" "%1"'
|
||||
@@ -90,9 +87,15 @@ Section -Configure
|
||||
# .FCStd
|
||||
WriteRegStr SHCTX "Software\Classes\${APP_EXT}" "" "${APP_REGNAME_DOC}"
|
||||
WriteRegStr SHCTX "Software\Classes\${APP_EXT}" "Content Type" "${APP_MIME_TYPE}"
|
||||
# FIXME: what about .FCMat and .FCMacro?
|
||||
|
||||
# Refresh shell
|
||||
# if the user is admin, also install the DLL toe preview .FCStd files
|
||||
${if} $MultiUser.Privileges == "Admin"
|
||||
# see https://nsis.sourceforge.io/Docs/AppendixB.html#library_install for a description of InstallLib
|
||||
!insertmacro InstallLib REGDLL NOTSHARED NOREBOOT_NOTPROTECTED ${FILES_THUMBS}\FCStdThumbnail.dll $SYSDIR\FCStdThumbnail.dll $SYSDIR
|
||||
${endif}
|
||||
# in any case remove the FCStdThumbnail.dll
|
||||
RMDir /r "$INSTDIR\thumbnail"
|
||||
|
||||
# Eventually refresh shell icons
|
||||
${RefreshShellIcons}
|
||||
${endif}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ Section -ProgramFiles SecProgramFiles
|
||||
File /r "${FILES_FREECAD}\lib"
|
||||
File /r "${FILES_FREECAD}\Mod"
|
||||
File /r "${FILES_FREECAD}\resources"
|
||||
File /r "${FILES_THUMBS}"
|
||||
|
||||
# Create uninstaller
|
||||
WriteUninstaller "$INSTDIR\${SETUP_UNINSTALLER}"
|
||||
|
||||
@@ -28,6 +28,8 @@ Section "un.FreeCAD" un.SecUnProgramFiles
|
||||
${endif}
|
||||
${if} $MultiUser.Privileges == "Admin"
|
||||
DeleteRegKey HKCR "${APP_NAME}.Document"
|
||||
# see https://nsis.sourceforge.io/Docs/AppendixB.html#library_install for a description of UnInstallLib
|
||||
!insertmacro UnInstallLib REGDLL NOTSHARED NOREBOOT_NOTPROTECTED $SYSDIR\FCStdThumbnail.dll
|
||||
${endif}
|
||||
|
||||
# Uninstaller itself
|
||||
@@ -55,6 +57,9 @@ Section "un.FreeCAD" un.SecUnProgramFiles
|
||||
# clean other registry entries
|
||||
DeleteRegKey SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}.exe"
|
||||
DeleteRegKey SHCTX "SOFTWARE\${APP_REGKEY}"
|
||||
|
||||
# Eventually refresh shell icons
|
||||
${RefreshShellIcons}
|
||||
|
||||
SectionEnd
|
||||
|
||||
|
||||
Reference in New Issue
Block a user