Warning, /graphics/digikam/project/bundles/mxe/installer/digikam.nsi is written in an unsupported language. File is not indexed.
0001 ;; ============================================================ 0002 ; 0003 ; This file is a part of digiKam project 0004 ; https://www.digikam.org 0005 ; 0006 ; Date : 2010-11-08 0007 ; Description : Null Soft Windows Installer based for digiKam. 0008 ; Note: NSIS >= 3 is required to be compatible with Windows 10. 0009 ; 0010 ; SPDX-FileCopyrightText: 2010 by Julien Narboux <julien at narboux dot fr> 0011 ; SPDX-FileCopyrightText: 2011-2014 by Ananta Palani <anantapalani at gmail dot com> 0012 ; SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0013 ; 0014 ; Script arguments: 0015 ; VERSION : the digiKam version as string. 0016 ; BUNDLEPATH : the path where whole digiKam bundle is installed. 0017 ; TARGETARCH : the target Windows architecture (32 or 64 bits). 0018 ; OUTPUT : the output installer file name as string. 0019 ; 0020 ; Example: makensis -DVERSION=5.0.0 -DTARGETARCH=32 -DBUNDLEPATH=../bundle digikam.nsi 0021 ; 0022 ; NSIS script reference can be found at this url: 0023 ; https://nsis.sourceforge.net/Docs/Chapter4.html 0024 ; 0025 ; SPDX-License-Identifier: GPL-2.0-or-later 0026 ; 0027 ; ============================================================ ;; 0028 0029 ;------------------------------------------------------------------------------- 0030 ;Verbose level (no script) 0031 0032 !verbose 4 0033 0034 ;------------------------------------------------------------------------------- 0035 ; Compression rules optimizations 0036 ; We will use LZMA compression as 7Zip, with a dictionary size of 96Mb (to reproduce 7Zip Ultra compression mode) 0037 0038 SetCompress force 0039 SetCompressor /SOLID lzma 0040 SetDatablockOptimize on 0041 SetCompressorDictSize 96 0042 0043 ;------------------------------------------------------------------------------- 0044 ;Include Modern UI 0045 0046 ; Turn on UTF-8 strings encoding support. 0047 Unicode true 0048 0049 ; Add support to hdpi screen. This require NSIS >= 3.x 0050 ManifestDPIAware true 0051 0052 !include "MUI2.nsh" 0053 !define MY_PRODUCT "digiKam" 0054 !define PRODUCT_HOMEPAGE "https://www.digikam.org" 0055 !define SUPPORT_HOMEPAGE "https://www.digikam.org/support" 0056 !define ABOUT_HOMEPAGE "https://www.digikam.org/about" 0057 !define OUTFILE "${OUTPUT}" 0058 0059 ;------------------------------------------------------------------------------- 0060 ;General Setup 0061 0062 ;Name and file 0063 0064 Name "${MY_PRODUCT} ${VERSION}" 0065 Icon "digikam-installer.ico" 0066 BrandingText "digiKam Project (https://www.digikam.org)" 0067 UninstallIcon "digikam-uninstaller.ico" 0068 OutFile "${OUTFILE}" 0069 0070 ; Add Installer Windows file properties 0071 0072 VIProductVersion ${VERSION}.0 0073 VIAddVersionKey /LANG=0 "ProductName" "${MY_PRODUCT}" 0074 VIAddVersionKey /LANG=0 "ProductVersion" "${VERSION}" 0075 VIAddVersionKey /LANG=0 "Comments" "Professional Photo Management with the Power of Open Source" 0076 VIAddVersionKey /LANG=0 "CompanyName" "digiKam.org" 0077 VIAddVersionKey /LANG=0 "InternalName" "${MY_PRODUCT}" 0078 VIAddVersionKey /LANG=0 "LegalTrademarks" "https://www.digikam.org" 0079 VIAddVersionKey /LANG=0 "LegalCopyright" "digiKam developers team" 0080 VIAddVersionKey /LANG=0 "FileDescription" "digiKam Application Installer for Windows" 0081 VIAddVersionKey /LANG=0 "FileVersion" "${VERSION}" 0082 VIAddVersionKey /LANG=0 "PrivateBuild" "MXE Toolchain" 0083 VIAddVersionKey /LANG=0 "SpecialBuild" "MinGW Compiler" 0084 0085 ;Request application privileges for Windows Vista and upper versions 0086 0087 RequestExecutionLevel admin 0088 0089 !include x64.nsh 0090 0091 ;Get installation folder from registry if available 0092 0093 InstallDirRegKey HKLM "Software\${MY_PRODUCT}" "" 0094 0095 !include "LogicLib.nsh" 0096 !include "StrFunc.nsh" 0097 ${StrRep} 0098 ${StrStr} 0099 ${StrStrAdv} 0100 0101 ;Extra local scripts 0102 0103 !include "process_running.nsh" 0104 !include "reboot_required.nsh" 0105 !include "readme_page.nsh" 0106 !include "events_functions.nsh" 0107 0108 ;------------------------------------------------------------------------------- 0109 ;Interface Configuration 0110 0111 !define MUI_HEADERIMAGE 0112 !define MUI_HEADERIMAGE_BITMAP "digikam_header.bmp" 0113 !define MUI_WELCOMEFINISHPAGE_BITMAP "digikam_welcome.bmp" 0114 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "digikam_welcome.bmp" 0115 !define MUI_ABORTWARNING 0116 !define MUI_ICON "digikam-installer.ico" 0117 !define MUI_UNICON "digikam-uninstaller.ico" 0118 !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED 0119 !define MUI_FINISHPAGE_SHOWREADME "$instdir\releasenotes.html" 0120 !define MUI_FINISHPAGE_RUN 0121 !define MUI_FINISHPAGE_RUN_NOTCHECKED 0122 !define MUI_FINISHPAGE_RUN_TEXT "Start digiKam" 0123 !define MUI_FINISHPAGE_RUN_FUNCTION functionFinishRun 0124 !define MUI_FINISHPAGE_LINK "Visit digiKam project website" 0125 !define MUI_FINISHPAGE_LINK_LOCATION "https://www.digikam.org" 0126 0127 ;------------------------------------------------------------------------------- 0128 ;Page Definitions 0129 0130 ;Variable for the folder of the start menu 0131 0132 Var StartMenuFolder 0133 0134 !insertmacro MUI_PAGE_WELCOME 0135 !insertmacro MUI_PAGE_README "ABOUT.txt" 0136 !insertmacro MUI_PAGE_LICENSE "GPL.txt" 0137 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeave 0138 !insertmacro MUI_PAGE_DIRECTORY 0139 0140 ;Start Menu Folder Page Configuration 0141 0142 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM" 0143 !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${MY_PRODUCT}" 0144 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" 0145 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder 0146 0147 !insertmacro MUI_PAGE_INSTFILES 0148 !insertmacro MUI_PAGE_FINISH 0149 !insertmacro MUI_UNPAGE_WELCOME 0150 !insertmacro MUI_UNPAGE_CONFIRM 0151 !insertmacro MUI_UNPAGE_INSTFILES 0152 0153 ;------------------------------------------------------------------------------- 0154 ;Languages List 0155 0156 !insertmacro MUI_LANGUAGE "English" 0157 !insertmacro MUI_LANGUAGE "French" 0158 !insertmacro MUI_LANGUAGE "German" 0159 !insertmacro MUI_LANGUAGE "Spanish" 0160 !insertmacro MUI_LANGUAGE "SpanishInternational" 0161 !insertmacro MUI_LANGUAGE "SimpChinese" 0162 !insertmacro MUI_LANGUAGE "TradChinese" 0163 !insertmacro MUI_LANGUAGE "Japanese" 0164 !insertmacro MUI_LANGUAGE "Korean" 0165 !insertmacro MUI_LANGUAGE "Italian" 0166 !insertmacro MUI_LANGUAGE "Dutch" 0167 !insertmacro MUI_LANGUAGE "Danish" 0168 !insertmacro MUI_LANGUAGE "Swedish" 0169 !insertmacro MUI_LANGUAGE "Norwegian" 0170 !insertmacro MUI_LANGUAGE "NorwegianNynorsk" 0171 !insertmacro MUI_LANGUAGE "Finnish" 0172 !insertmacro MUI_LANGUAGE "Greek" 0173 !insertmacro MUI_LANGUAGE "Russian" 0174 !insertmacro MUI_LANGUAGE "Portuguese" 0175 !insertmacro MUI_LANGUAGE "PortugueseBR" 0176 !insertmacro MUI_LANGUAGE "Polish" 0177 !insertmacro MUI_LANGUAGE "Ukrainian" 0178 !insertmacro MUI_LANGUAGE "Czech" 0179 !insertmacro MUI_LANGUAGE "Slovak" 0180 !insertmacro MUI_LANGUAGE "Croatian" 0181 !insertmacro MUI_LANGUAGE "Bulgarian" 0182 !insertmacro MUI_LANGUAGE "Hungarian" 0183 !insertmacro MUI_LANGUAGE "Thai" 0184 !insertmacro MUI_LANGUAGE "Romanian" 0185 !insertmacro MUI_LANGUAGE "Latvian" 0186 !insertmacro MUI_LANGUAGE "Macedonian" 0187 !insertmacro MUI_LANGUAGE "Estonian" 0188 !insertmacro MUI_LANGUAGE "Turkish" 0189 !insertmacro MUI_LANGUAGE "Lithuanian" 0190 !insertmacro MUI_LANGUAGE "Slovenian" 0191 !insertmacro MUI_LANGUAGE "Serbian" 0192 !insertmacro MUI_LANGUAGE "SerbianLatin" 0193 !insertmacro MUI_LANGUAGE "Arabic" 0194 !insertmacro MUI_LANGUAGE "Farsi" 0195 !insertmacro MUI_LANGUAGE "Hebrew" 0196 !insertmacro MUI_LANGUAGE "Indonesian" 0197 !insertmacro MUI_LANGUAGE "Mongolian" 0198 !insertmacro MUI_LANGUAGE "Luxembourgish" 0199 !insertmacro MUI_LANGUAGE "Albanian" 0200 !insertmacro MUI_LANGUAGE "Breton" 0201 !insertmacro MUI_LANGUAGE "Belarusian" 0202 !insertmacro MUI_LANGUAGE "Icelandic" 0203 !insertmacro MUI_LANGUAGE "Malay" 0204 !insertmacro MUI_LANGUAGE "Bosnian" 0205 !insertmacro MUI_LANGUAGE "Kurdish" 0206 !insertmacro MUI_LANGUAGE "Irish" 0207 !insertmacro MUI_LANGUAGE "Uzbek" 0208 !insertmacro MUI_LANGUAGE "Galician" 0209 !insertmacro MUI_LANGUAGE "Afrikaans" 0210 !insertmacro MUI_LANGUAGE "Catalan" 0211 !insertmacro MUI_LANGUAGE "Esperanto" 0212 0213 ;------------------------------------------------------------------------------- 0214 ;Installer Sections 0215 0216 Section "digiKam" SecDigiKam 0217 0218 ;Check running processes prior to install 0219 0220 Call CheckDigikamRunning 0221 Call CheckShowfotoRunning 0222 0223 ;See bug #437813: be sure that all background ExifTool process are done 0224 0225 nsExec::ExecToLog /TIMEOUT=2000 'taskkill.exe /F /T /IM exiftool.exe' 0226 0227 SetOutPath "$INSTDIR" 0228 0229 File "../data/releasenotes.html" 0230 File "digikam-uninstaller.ico" 0231 0232 ;Copy only required directories 0233 ;The SetOutPath is required because otherwise NSIS will assume all files are 0234 ;in the same folder even though they are sourced from different folders 0235 ;The \*.* is required for File /r because without it, NSIS would add every 0236 ;folder with the name 'bin' in all subdirectories of ${BUNDLEPATH} 0237 0238 SetOutPath "$INSTDIR\" 0239 File "${BUNDLEPATH}\*.exe" 0240 File "${BUNDLEPATH}\*.conf" 0241 File "${BUNDLEPATH}\*.rcc" 0242 File "${BUNDLEPATH}\*.dll" 0243 File "${BUNDLEPATH}\*.yes" 0244 File "${BUNDLEPATH}\*.txt" 0245 0246 SetOutPath "$INSTDIR\etc" 0247 File /r "${BUNDLEPATH}\etc\*.*" 0248 0249 SetOutPath "$INSTDIR\data" 0250 File /r "${BUNDLEPATH}\data\*.*" 0251 0252 SetOutPath "$INSTDIR\share" 0253 File /r "${BUNDLEPATH}\share\*.*" 0254 0255 SetOutPath "$INSTDIR\plugins" 0256 File /r "${BUNDLEPATH}\plugins\*.*" 0257 0258 SetOutPath "$INSTDIR\translations" 0259 File /r "${BUNDLEPATH}\translations\*.*" 0260 0261 SetOutPath "$INSTDIR\libgphoto2" 0262 File /r "${BUNDLEPATH}\libgphoto2\*.*" 0263 0264 SetOutPath "$INSTDIR\libgphoto2_port" 0265 File /r "${BUNDLEPATH}\libgphoto2_port\*.*" 0266 0267 ;Store installation folder 0268 0269 WriteRegStr HKLM "Software\${MY_PRODUCT}" "" $INSTDIR 0270 0271 ;Create uninstaller 0272 0273 WriteUninstaller "$INSTDIR\Uninstall.exe" 0274 0275 ;Register uninstaller in windows registry with only the option to uninstall (no repair nor modify) 0276 0277 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "Comments" "${MY_PRODUCT} ${VERSION}" 0278 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "DisplayIcon" '"$INSTDIR\digikam.exe"' 0279 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "DisplayName" "${MY_PRODUCT} ${VERSION}" 0280 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "DisplayVersion" "${VERSION}" 0281 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "HelpLink" "${SUPPORT_HOMEPAGE}" 0282 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "InstallLocation" "$INSTDIR" 0283 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "Publisher" "The digiKam team" 0284 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "Readme" '"$INSTDIR\releasenotes.html"' 0285 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "UninstallString" '"$INSTDIR\Uninstall.exe"' 0286 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "URLInfoAbout" "${ABOUT_HOMEPAGE}" 0287 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "URLUpdateInfo" "${PRODUCT_HOMEPAGE}" 0288 0289 ;Calculate the install size so that it can be shown in the uninstall interface in Windows 0290 ;see http://nsis.sourceforge.net/Add_uninstall_information_to_Add/Remove_Programs 0291 ;this isn't the most accurate method but it is very fast and is accurate enough for an estimate 0292 0293 push $0 0294 SectionGetSize ${SecDigiKam} $0 0295 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "EstimatedSize" "$0" 0296 pop $0 0297 0298 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "NoModify" "1" 0299 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" "NoRepair" "1" 0300 0301 ;Add start menu items to All Users 0302 0303 SetShellVarContext all 0304 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application 0305 0306 ;Create shortcuts 0307 0308 CreateDirectory "$SMPROGRAMS\$StartMenuFolder" 0309 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${MY_PRODUCT}.lnk" "$INSTDIR\digikam.exe" 0310 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Showfoto.lnk" "$INSTDIR\showfoto.exe" 0311 0312 WriteINIStr "$SMPROGRAMS\$StartMenuFolder\The ${MY_PRODUCT} HomePage.url" "InternetShortcut" "URL" "${PRODUCT_HOMEPAGE}" 0313 WriteINIStr "$SMPROGRAMS\$StartMenuFolder\The ${MY_PRODUCT} HomePage.url" "InternetShortcut" "IconIndex" "12" 0314 WriteINIStr "$SMPROGRAMS\$StartMenuFolder\The ${MY_PRODUCT} HomePage.url" "InternetShortcut" "IconFile" "$windir\explorer.exe" 0315 0316 !insertmacro MUI_STARTMENU_WRITE_END 0317 0318 SectionEnd 0319 0320 ;------------------------------------------------------------------------------- 0321 ;Uninstaller Section 0322 0323 Section "Uninstall" 0324 0325 ;Check running processes prior to uninstall 0326 0327 Call un.CheckDigikamRunning 0328 Call un.CheckShowfotoRunning 0329 0330 ;See bug #437813: be sure that all background ExifTool process are done 0331 0332 nsExec::ExecToLog /TIMEOUT=2000 'taskkill.exe /F /T /IM exiftool.exe' 0333 0334 Delete "$INSTDIR\*.exe" 0335 Delete "$INSTDIR\*.conf" 0336 Delete "$INSTDIR\*.rcc" 0337 Delete "$INSTDIR\*.dll" 0338 Delete "$INSTDIR\*.yes" 0339 Delete "$INSTDIR\*.txt" 0340 0341 Delete "$INSTDIR\Uninstall.exe" 0342 Delete "$INSTDIR\releasenotes.html" 0343 Delete "$INSTDIR\digikam-uninstaller.ico" 0344 0345 RMDir /r "$INSTDIR\bin" 0346 RMDir /r "$INSTDIR\etc" 0347 RMDir /r "$INSTDIR\data" 0348 RMDir /r "$INSTDIR\share" 0349 RMDir /r "$INSTDIR\plugins" 0350 RMDir /r "$INSTDIR\translations" 0351 RMDir /r "$INSTDIR\libgphoto2" 0352 RMDir /r "$INSTDIR\libgphoto2_port" 0353 0354 ;Do not do a recursive removal of $INSTDIR because user may have accidentally installed into system critical directory! 0355 0356 RMDir "$INSTDIR" 0357 0358 ;Remove start menu items 0359 0360 SetShellVarContext all 0361 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder 0362 0363 Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" 0364 Delete "$SMPROGRAMS\$StartMenuFolder\${MY_PRODUCT}.lnk" 0365 Delete "$SMPROGRAMS\$StartMenuFolder\Showfoto.lnk" 0366 Delete "$SMPROGRAMS\$StartMenuFolder\The ${MY_PRODUCT} HomePage.url" 0367 0368 RMDir "$SMPROGRAMS\$StartMenuFolder" 0369 0370 ;Remove registry entries 0371 0372 DeleteRegValue HKLM "Software\${MY_PRODUCT}" "" 0373 DeleteRegValue HKLM "Software\${MY_PRODUCT}" "Start Menu Folder" 0374 DeleteRegKey /ifempty HKLM "Software\${MY_PRODUCT}" 0375 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MY_PRODUCT}" 0376 0377 SectionEnd