Warning, /network/falkon/windows/installer.nsi is written in an unsupported language. File is not indexed.

0001 ; Falkon Windows Installer NSIS Script
0002 ; Copyright (C) 2010-2017  David Rosca <nowrep@gmail.com>
0003 ;               2012-2017  S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
0004 ;
0005 ; For compiling this script you need following plugins:
0006 ; FindProcDLL_plug-in, KillProcDLL_plug-in and 'AllAssociation.nsh' needs
0007 ; Registry_plug-in, Application_Association_Registration_plug-in
0008 ; Unicode version of them can be downloaded from:
0009 ; http://sourceforge.net/projects/findkillprocuni/files/bin/
0010 ; http://nsis.sourceforge.net/Application_Association_Registration_plug-in
0011 ; http://nsis.sourceforge.net/Registry_plug-in
0012 
0013 !ifndef CUSTOM
0014   !define VERSION 3.0.0
0015   !define ARCH x86
0016   !define MSVC_VER 140
0017   !define OPENSSL_BIN_DIR .
0018   !define MSVC_REDIST_DIR .
0019   !define FALKON_SRC_DIR ..\..\
0020   !define FALKON_BIN_DIR .
0021   !define ICU_BIN_DIR .
0022   !define QT_DIR .
0023   !define QT_BIN_DIR .
0024   !define QT_PLUGINS_DIR .
0025   !define QTWEBENGINE_DICTIONARIES_DIR qtwebengine_dictionaries
0026   !undef PORTABLE
0027 !endif
0028 
0029 ; WinVer.nsh was added in the same release that RequestExecutionLevel so check
0030 ; if ___WINVER__NSH___ is defined to determine if RequestExecutionLevel is
0031 ; available.
0032 !include /NONFATAL WinVer.nsh
0033 !include x64.nsh
0034 
0035 Var installAsPortable
0036 RequestExecutionLevel admin
0037 
0038 !addplugindir "wininstall\"
0039 
0040 !include "StdUtils.nsh"
0041 !include "FileFunc.nsh"
0042 !include "wininstall\AllAssociation.nsh"
0043 SetCompressor /SOLID /FINAL lzma
0044 
0045 !define PRODUCT_NAME "Falkon"
0046 !define /date PRODUCT_VERSION "${VERSION}"
0047 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\falkon.exe"
0048 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
0049 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
0050 !define PRODUCT_CAPABILITIES_KEY "Software\${PRODUCT_NAME}\Capabilities"
0051 
0052 !include "MUI.nsh"
0053 !define MUI_ABORTWARNING
0054 !define MUI_ICON "wininstall\install.ico"
0055 !define MUI_UNICON "wininstall\uninstall.ico"
0056 !define MUI_WELCOMEFINISHPAGE_BITMAP "wininstall\welcome.bmp"
0057 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "wininstall\welcome.bmp"
0058 
0059 !insertmacro MUI_PAGE_WELCOME
0060 !insertmacro MUI_PAGE_LICENSE ${FALKON_BIN_DIR}\COPYRIGHT.txt
0061 ;;;
0062 Page custom InstallationModePage InstallationModeLeave
0063 ;;;
0064 !define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipComponentsIfPortableInstalltion"
0065 !insertmacro MUI_PAGE_COMPONENTS
0066 !insertmacro MUI_PAGE_DIRECTORY
0067 ;;;
0068 Page custom installationInfoPage installationInfoLeave
0069 ;;;
0070 !insertmacro MUI_PAGE_INSTFILES
0071 
0072 !define MUI_FINISHPAGE_RUN
0073 !define MUI_FINISHPAGE_RUN_FUNCTION "RunFalkonAsUser"
0074 !insertmacro MUI_PAGE_FINISH
0075 
0076 !insertmacro MUI_UNPAGE_WELCOME
0077 !insertmacro MUI_UNPAGE_CONFIRM
0078 !insertmacro MUI_UNPAGE_INSTFILES
0079 !insertmacro MUI_UNPAGE_FINISH
0080 
0081 !insertmacro MUI_LANGUAGE "English"
0082 
0083 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
0084 OutFile "${PRODUCT_NAME} Installer ${PRODUCT_VERSION}.exe"
0085 InstallDir "$PROGRAMFILES\${PRODUCT_NAME}\"
0086 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
0087 ShowInstDetails show
0088 ShowUnInstDetails show
0089 
0090 !include "wininstall\strings.nsh"
0091 
0092 Section "${TITLE_SecMain}" SecMain
0093   SectionIn RO
0094   FindProcDLL::FindProc "falkon.exe"
0095   IntCmp $R0 1 0 notRunning
0096   MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "${MSG_RunningInstance}" /SD IDOK IDCANCEL AbortInstallation
0097     KillProcDLL::KillProc "falkon.exe"
0098     Sleep 100
0099     Goto notRunning
0100 AbortInstallation:
0101   Abort "${MSG_InstallationCanceled}"
0102 
0103 notRunning:
0104   SetOverwrite on
0105 
0106   SetOutPath "$INSTDIR"
0107   File "${FALKON_BIN_DIR}\COPYRIGHT.txt"
0108   File "${FALKON_BIN_DIR}\falkon.exe"
0109   File "${FALKON_BIN_DIR}\falkonprivate.dll"
0110   File "${FALKON_BIN_DIR}\qt.conf"
0111   File "${OPENSSL_BIN_DIR}\libeay32.dll"
0112   File "${OPENSSL_BIN_DIR}\ssleay32.dll"
0113   File /nonfatal "${OPENSSL_BIN_DIR}\msvcr*.dll"
0114   File "${MSVC_REDIST_DIR}\*"
0115   File "${ICU_BIN_DIR}\icudt54.dll"
0116   File "${ICU_BIN_DIR}\icuin54.dll"
0117   File "${ICU_BIN_DIR}\icuuc54.dll"
0118   File "${QT_BIN_DIR}\libEGL.dll"
0119   File "${QT_BIN_DIR}\libGLESv2.dll"
0120   File "${QT_BIN_DIR}\opengl32sw.dll"
0121   File "${QT_BIN_DIR}\D3Dcompiler_47.dll"
0122   File "${QT_BIN_DIR}\Qt5Core.dll"
0123   File "${QT_BIN_DIR}\Qt5Gui.dll"
0124   File "${QT_BIN_DIR}\Qt5Network.dll"
0125   File "${QT_BIN_DIR}\Qt5Positioning.dll"
0126   File "${QT_BIN_DIR}\Qt5PrintSupport.dll"
0127   File "${QT_BIN_DIR}\Qt5Qml.dll"
0128   File "${QT_BIN_DIR}\Qt5Quick.dll"
0129   File "${QT_BIN_DIR}\Qt5QuickWidgets.dll"
0130   File "${QT_BIN_DIR}\Qt5Sql.dll"
0131   File "${QT_BIN_DIR}\Qt5Svg.dll"
0132   File "${QT_BIN_DIR}\Qt5WinExtras.dll"
0133   File "${QT_BIN_DIR}\Qt5WebEngine.dll"
0134   File "${QT_BIN_DIR}\Qt5WebEngineCore.dll"
0135   File "${QT_BIN_DIR}\Qt5WebEngineWidgets.dll"
0136   File "${QT_BIN_DIR}\Qt5WebChannel.dll"
0137   File "${QT_BIN_DIR}\Qt5Widgets.dll"
0138   File "${QT_BIN_DIR}\QtWebEngineProcess.exe"
0139 
0140   SetOutPath "$INSTDIR\iconengines"
0141   File "${QT_PLUGINS_DIR}\iconengines\qsvgicon.dll"
0142 
0143   SetOutPath "$INSTDIR\imageformats"
0144   File "${QT_PLUGINS_DIR}\imageformats\*.dll"
0145 
0146   SetOutPath "$INSTDIR\platforms"
0147   File "${QT_PLUGINS_DIR}\platforms\qwindows.dll"
0148 
0149   SetOutPath "$INSTDIR\printsupport"
0150   File "${QT_PLUGINS_DIR}\printsupport\windowsprintersupport.dll"
0151 
0152   SetOutPath "$INSTDIR\qml\QtQuick.2"
0153   File "${QT_DIR}\qml\QtQuick.2\*"
0154 
0155   SetOutPath "$INSTDIR\qml\QtWebEngine"
0156   File "${QT_DIR}\qml\QtWebEngine\*"
0157 
0158   SetOutPath "$INSTDIR\resources"
0159   File "${QT_DIR}\resources\*"
0160 
0161   SetOutPath "$INSTDIR\sqldrivers"
0162   File "${QT_PLUGINS_DIR}\sqldrivers\qsqlite.dll"
0163 
0164   SetOutPath "$INSTDIR\styles"
0165   File "${QT_PLUGINS_DIR}\styles\*.dll"
0166 
0167   call RegisterCapabilities
0168 
0169   StrCmp $installAsPortable "YES" 0 skipPortableMode
0170   FileOpen $0 $INSTDIR\falkon.conf w
0171   FileWrite $0 "[Config]$\r$\n"
0172   FileWrite $0 "Portable=true$\r$\n"
0173 
0174   StrCmp $0 "" 0 closeHandle
0175   MessageBox MB_OK|MB_ICONEXCLAMATION "${MSG_PortableWriteError}"
0176   goto skipPortableMode
0177 
0178 closeHandle:
0179   FileClose $0
0180 
0181 skipPortableMode:
0182 SectionEnd
0183 
0184 SectionGroup "${TITLE_SecThemes}" SecThemes
0185 
0186   Section Default SecDefault
0187   SectionIn RO
0188   SetOutPath "$INSTDIR\themes\windows"
0189   File "${FALKON_SRC_DIR}\themes\windows\*"
0190   SetOutPath "$INSTDIR\themes\windows\images"
0191   File "${FALKON_SRC_DIR}\themes\windows\images\*"
0192   SectionEnd
0193 
0194   Section Chrome SecChrome
0195   SetOutPath "$INSTDIR\themes\chrome"
0196   File "${FALKON_SRC_DIR}\themes\chrome\*"
0197   SetOutPath "$INSTDIR\themes\chrome\images"
0198   File "${FALKON_SRC_DIR}\themes\chrome\images\*"
0199   SectionEnd
0200 
0201   Section Mac SecMac
0202   SetOutPath "$INSTDIR\themes\mac"
0203   File "${FALKON_SRC_DIR}\themes\mac\*"
0204   SetOutPath "$INSTDIR\themes\mac\images"
0205   File "${FALKON_SRC_DIR}\themes\mac\images\*"
0206   SectionEnd
0207 SectionGroupEnd
0208 
0209 Section "${TITLE_SecTranslations}" SecTranslations
0210   SetOutPath "$INSTDIR\locale"
0211   File /r "${FALKON_BIN_DIR}\locale\*"
0212 
0213   SetOutPath "$INSTDIR\translations\qtwebengine_locales"
0214   File "${QT_DIR}\translations\qtwebengine_locales\*"
0215 
0216   SetOutPath "$INSTDIR\qtwebengine_dictionaries\doc"
0217   ; In some packages underline '_' is used and in some other packages dash '-' is used so we use wildcard
0218   File "${QTWEBENGINE_DICTIONARIES_DIR}\doc\README*en*US.txt"
0219 
0220   SetOutPath "$INSTDIR\qtwebengine_dictionaries"
0221   ; in some packages *.bdic files use dash '-' instead of underline '_' followed by a version number. e.g. en-US-3-0.bdic
0222   File "${QTWEBENGINE_DICTIONARIES_DIR}\en*US*.bdic"
0223 SectionEnd
0224 
0225 Section "${TITLE_SecPlugins}" SecPlugins
0226   SetOutPath "$INSTDIR\plugins"
0227   File "${FALKON_BIN_DIR}\plugins\*.dll"
0228 SectionEnd
0229 
0230 
0231 SectionGroup "${TITLE_SecSetASDefault}" SecSetASDefault
0232     Section "${TITLE_SecExtensions}" SecExtensions
0233       StrCmp $installAsPortable "NO" 0 skipSetExtentions
0234       SetOutPath "$INSTDIR"
0235       ${RegisterAssociation} ".htm" "$INSTDIR\falkon.exe" "FalkonHTML" "Falkon HTML Document" "$INSTDIR\falkon.exe,1" "file"
0236       ${RegisterAssociation} ".html" "$INSTDIR\falkon.exe" "FalkonHTML" "Falkon HTML Document" "$INSTDIR\falkon.exe,1" "file"
0237       ${UpdateSystemIcons}
0238       skipSetExtentions:
0239     SectionEnd
0240 
0241     Section "${TITLE_SecProtocols}" SecProtocols
0242       StrCmp $installAsPortable "NO" 0 skipSecProtocols
0243       ${RegisterAssociation} "http" "$INSTDIR\falkon.exe" "FalkonURL" "Falkon URL" "$INSTDIR\falkon.exe,0" "protocol"
0244       ${RegisterAssociation} "https" "$INSTDIR\falkon.exe" "FalkonURL" "Falkon URL" "$INSTDIR\falkon.exe,0" "protocol"
0245       ${RegisterAssociation} "ftp" "$INSTDIR\falkon.exe" "FalkonURL" "Falkon URL" "$INSTDIR\falkon.exe,0" "protocol"
0246       ${UpdateSystemIcons}
0247       skipSecProtocols:
0248     SectionEnd
0249 SectionGroupEnd
0250 
0251 Section -StartMenu
0252   StrCmp $installAsPortable "NO" 0 skipStartMenu
0253   SetOutPath "$INSTDIR"
0254   SetShellVarContext all
0255   CreateDirectory "$SMPROGRAMS\Falkon"
0256   CreateShortCut "$SMPROGRAMS\Falkon\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
0257   CreateShortCut "$SMPROGRAMS\Falkon\Falkon.lnk" "$INSTDIR\falkon.exe"
0258   CreateShortCut "$SMPROGRAMS\Falkon\License.lnk" "$INSTDIR\COPYRIGHT.txt"
0259   skipStartMenu:
0260 SectionEnd
0261 
0262 Section "${TITLE_SecDesktop}" SecDesktop
0263   StrCmp $installAsPortable "NO" 0 skipDesktopIcon
0264   SetOutPath "$INSTDIR"
0265   CreateShortCut "$DESKTOP\Falkon.lnk" "$INSTDIR\falkon.exe" ""
0266   skipDesktopIcon:
0267 SectionEnd
0268 
0269 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
0270   !insertmacro MUI_DESCRIPTION_TEXT ${SecMain} "${DESC_SecMain}"
0271   !insertmacro MUI_DESCRIPTION_TEXT ${SecTranslations} "${DESC_SecTranslations}"
0272   !insertmacro MUI_DESCRIPTION_TEXT ${SecPlugins} "${DESC_SecPlugins}"
0273 
0274   !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "${DESC_SecDesktop}"
0275   !insertmacro MUI_DESCRIPTION_TEXT ${SecExtensions} "${DESC_SecExtensions}"
0276 
0277   !insertmacro MUI_DESCRIPTION_TEXT ${SecThemes} "${DESC_SecThemes}"
0278   !insertmacro MUI_DESCRIPTION_TEXT ${SecSetASDefault} "${DESC_SecSetASDefault}"
0279   !insertmacro MUI_DESCRIPTION_TEXT ${SecProtocols} "${DESC_SecProtocols}"
0280 !insertmacro MUI_FUNCTION_DESCRIPTION_END
0281 
0282 Section -Uninstaller
0283   StrCmp $installAsPortable "NO" 0 skipUninstaller
0284   WriteUninstaller "$INSTDIR\uninstall.exe"
0285   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\falkon.exe"
0286   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
0287   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe"
0288   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\falkon.exe"
0289   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
0290   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "Falkon Team"
0291   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "HelpLink" "https://userbase.kde.org/Falkon"
0292   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
0293   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallSource" "$EXEDIR"
0294   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "https://falkon.org"
0295   ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
0296   WriteRegDWORD ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "EstimatedSize" "$0"
0297   skipUninstaller:
0298 SectionEnd
0299 
0300 Section Uninstall
0301   FindProcDLL::FindProc "falkon.exe"
0302   IntCmp $R0 1 0 notRunning
0303   MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "${MSG_RunningInstance}" /SD IDOK IDCANCEL AbortInstallation
0304     KillProcDLL::KillProc "falkon.exe"
0305     Sleep 100
0306     Goto notRunning
0307 AbortInstallation:
0308   Abort "${MSG_InstallationCanceled}"
0309 
0310 notRunning:
0311   SetShellVarContext all
0312   Delete "$DESKTOP\Falkon.lnk"
0313 
0314   Delete "$INSTDIR\falkon.exe"
0315   Delete "$INSTDIR\falkonprivate.dll"
0316   Delete "$INSTDIR\uninstall.exe"
0317   Delete "$INSTDIR\COPYRIGHT.txt"
0318   Delete "$INSTDIR\qt.conf"
0319   Delete "$INSTDIR\libeay32.dll"
0320   Delete "$INSTDIR\ssleay32.dll"
0321   Delete "$INSTDIR\libEGL.dll"
0322   Delete "$INSTDIR\libGLESv2.dll"
0323   Delete "$INSTDIR\opengl32sw.dll"
0324   Delete "$INSTDIR\D3Dcompiler_47.dll"
0325   Delete "$INSTDIR\QtWebEngineProcess.exe"
0326 
0327   ; Wildcard delete to compact script of uninstall section
0328   Delete "$INSTDIR\icu*.dll"
0329   Delete "$INSTDIR\Qt5*.dll"
0330   Delete "$INSTDIR\msvc*.dll"
0331   Delete "$INSTDIR\vc*.dll"
0332   Delete "$INSTDIR\concrt*.dll"
0333 
0334   ; Recursively delete folders in root of $INSTDIR
0335   RMDir /r "$INSTDIR\iconengines"
0336   RMDir /r "$INSTDIR\imageformats"
0337   RMDir /r "$INSTDIR\platforms"
0338   RMDir /r "$INSTDIR\printsupport"
0339   RMDir /r "$INSTDIR\qml"
0340   RMDir /r "$INSTDIR\resources"
0341   RMDir /r "$INSTDIR\translations"
0342   RMDir /r "$INSTDIR\sqldrivers"
0343   RMDir /r "$INSTDIR\styles"
0344   RMDir /r "$INSTDIR\qtwebengine_dictionaries"
0345   RMDir /r "$INSTDIR\themes"
0346   RMDir /r "$INSTDIR\locale"
0347   RMDir /r "$INSTDIR\plugins"
0348 
0349   ; Remove $INSTDIR if it is empty
0350   RMDir "$INSTDIR"
0351 
0352   ; Remove start menu programs folder
0353   RMDir /r "$SMPROGRAMS\${PRODUCT_NAME}"
0354 
0355   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
0356   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
0357 
0358   DeleteRegKey HKLM "Software\${PRODUCT_NAME}"
0359   DeleteRegValue HKLM "SOFTWARE\RegisteredApplications" "${PRODUCT_NAME}"
0360 
0361   ${UnRegisterAssociation} ".htm" "FalkonHTML" "$INSTDIR\falkon.exe" "file"
0362   ${UnRegisterAssociation} ".html" "FalkonHTML" "$INSTDIR\falkon.exe" "file"
0363   ${UnRegisterAssociation} "http" "FalkonURL" "$INSTDIR\falkon.exe" "protocol"
0364   ${UnRegisterAssociation} "https" "FalkonURL" "$INSTDIR\falkon.exe" "protocol"
0365   ${UnRegisterAssociation} "ftp" "FalkonURL" "$INSTDIR\falkon.exe" "protocol"
0366   ${UpdateSystemIcons}
0367 SectionEnd
0368 
0369 BrandingText "${PRODUCT_NAME} ${PRODUCT_VERSION} Installer"
0370 
0371 Function .onInit
0372         ;Prevent running installer of 64-bit Falkon on 32-bit Windows
0373         ${If} ${RunningX64}
0374           ${If} ${ARCH} == "x64"
0375             StrCpy $InstDir "$PROGRAMFILES64\${PRODUCT_NAME}\"
0376           ${Else}
0377             StrCpy $InstDir "$PROGRAMFILES32\${PRODUCT_NAME}\"
0378           ${Endif}
0379         ${Else}
0380           ${If} ${ARCH} == "x64"
0381             MessageBox MB_OK|MB_ICONEXCLAMATION "This installation requiers Windows x64!"
0382             Quit
0383           ${Else}
0384             StrCpy $InstDir "$PROGRAMFILES\${PRODUCT_NAME}\"
0385           ${Endif}
0386         ${EndIf}
0387 
0388         ;Extract InstallOptions files
0389         ;$PLUGINSDIR will automatically be removed when the installer closes
0390         InitPluginsDir
0391         File /oname=$PLUGINSDIR\portable-mode.ini "portable-mode.ini"
0392         File /oname=$PLUGINSDIR\portable-info.ini "portable-info.ini"
0393 
0394 
0395         ;Prevent Multiple Instances
0396         System::Call 'kernel32::CreateMutexA(i 0, i 0, t "FalkonInstaller-4ECB4694-2C39-4f93-9122-A986344C4E7B") i .r1 ?e'
0397         Pop $R0
0398         StrCmp $R0 0 skip
0399           ;Return when running silent instalation
0400           IfSilent doAbort 0
0401             MessageBox MB_OK|MB_ICONEXCLAMATION "Falkon installer is already running!" /SD IDOK
0402         doAbort:
0403             Abort
0404     skip:
0405         call notifyUserIfHotfixNeeded
0406 FunctionEnd
0407 
0408 Function RegisterCapabilities
0409     StrCmp $installAsPortable "NO" 0 skipRegisterCapabilities
0410     !ifdef ___WINVER__NSH___
0411         ${If} ${AtLeastWinVista}
0412             ; even if we don't associate Falkon as default for ".htm" and ".html"
0413             ; we need to write these ProgIds for future use!
0414             ;(e.g.: user uses "Default Programs" on Win7 or Vista to set Falkon as default.)
0415             ${CreateProgId} "FalkonHTML" "$INSTDIR\falkon.exe" "Falkon HTML Document" "$INSTDIR\falkon.exe,1"
0416             ${CreateProgId} "FalkonURL" "$INSTDIR\falkon.exe" "Falkon URL" "$INSTDIR\falkon.exe,0"
0417 
0418             ; note: these lines just introduce capabilities of Falkon to OS and don't change defaults!
0419             WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}" "ApplicationDescription" "${PRODUCT_DESC}"
0420             WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}" "ApplicationIcon" "$INSTDIR\falkon.exe,0"
0421             WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}" "ApplicationName" "${PRODUCT_NAME}"
0422             WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\FileAssociations" ".htm" "FalkonHTML"
0423             WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\FileAssociations" ".html" "FalkonHTML"
0424             WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\URLAssociations" "http" "FalkonURL"
0425             WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\URLAssociations" "https" "FalkonURL"
0426             WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\URLAssociations" "ftp" "FalkonURL"
0427             WriteRegStr HKLM "${PRODUCT_CAPABILITIES_KEY}\Startmenu" "StartMenuInternet" "$INSTDIR\falkon.exe"
0428             WriteRegStr HKLM "SOFTWARE\RegisteredApplications" "${PRODUCT_NAME}" "${PRODUCT_CAPABILITIES_KEY}"
0429         ${EndIf}
0430     !endif
0431 skipRegisterCapabilities:
0432 FunctionEnd
0433 
0434 Function RunFalkonAsUser
0435     ${StdUtils.ExecShellAsUser} $0 "$INSTDIR\falkon.exe" "open" ""
0436 FunctionEnd
0437 
0438 Function un.onInit
0439     ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY}  "${PRODUCT_UNINST_KEY}" "InstallLocation"
0440     IfErrors +2 0
0441         StrCpy $INSTDIR "$R0"
0442 
0443     IfFileExists "$INSTDIR\falkon.exe" found
0444         MessageBox MB_OK|MB_ICONSTOP "${MSG_InvalidInstallPath}"
0445         Abort
0446     found:
0447 FunctionEnd
0448 
0449 Function InstallationModePage
0450     !insertmacro MUI_HEADER_TEXT "${TITLE_InstallationMode}" "${DESC_InstallationMode}"
0451 
0452     WriteINIStr "$PLUGINSDIR\portable-mode.ini" "Field 1" "Text" "${TITLE_StandardInstallation}"
0453     WriteINIStr "$PLUGINSDIR\portable-mode.ini" "Field 2" "Text" "${TITLE_PortableInstallation}"
0454 
0455     InstallOptions::dialog $PLUGINSDIR\portable-mode.ini
0456 FunctionEnd
0457 
0458 Function InstallationModeLeave
0459   ReadINIStr $0 "$PLUGINSDIR\portable-mode.ini" "Field 2" "State"
0460 
0461   StrCmp $0 1 0 notchecked
0462   StrCpy $installAsPortable "YES"
0463   StrCpy $InstDir "$DESKTOP\${PRODUCT_NAME} Portable\"
0464 
0465   goto skip
0466 
0467  notchecked:
0468   StrCpy $installAsPortable "NO"
0469 
0470  skip:
0471 FunctionEnd
0472 
0473 Function installationInfoPage
0474     !insertmacro MUI_HEADER_TEXT "${TITLE_InstallInfo}" "${DESC_InstallInfo}"
0475 
0476     StrCmp $installAsPortable "NO" 0 infoPortable
0477     WriteINIStr "$PLUGINSDIR\portable-info.ini" "Field 1" "Text" "${DESC_StandardInstallation}"
0478 
0479     Goto showInfo
0480 
0481 infoPortable:
0482     WriteINIStr "$PLUGINSDIR\portable-info.ini" "Field 1" "Text" "${DESC_PortableInstallation}"
0483 
0484 showInfo:
0485     InstallOptions::dialog $PLUGINSDIR\portable-info.ini
0486 FunctionEnd
0487 
0488 Function installationInfoLeave
0489 FunctionEnd
0490 
0491 Function SkipComponentsIfPortableInstalltion
0492 StrCmp $installAsPortable "YES" 0 +2
0493     Abort
0494 FunctionEnd
0495 
0496 Function notifyUserIfHotfixNeeded
0497     ; check if Windows 10 family. Taken from: http://nsis.sourceforge.net/Get_Windows_version
0498     ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentMajorVersionNumber
0499     StrCmp $R0 '' 0 skiphotfixwarn
0500 
0501     ClearErrors
0502     nsExec::ExecToStack 'cmd /Q /C "%SYSTEMROOT%\System32\wbem\wmic.exe qfe get hotfixid | %SYSTEMROOT%\System32\findstr.exe "^KB2999226""'
0503     Pop $0 ; return value (it always 0 even if an error occured)
0504     Pop $1 ; command output KB2999226
0505 
0506     StrCmp $1 "" 0 skiphotfixwarn
0507       MessageBox MB_YESNO|MB_ICONQUESTION "${MSG_HotfixNeeded}" IDNO +2
0508         ExecShell open "https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows"
0509 
0510     skiphotfixwarn:
0511 FunctionEnd