NSIS.template.in 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. ;ownCloud installer script.
  2. !define APPLICATION_SHORTNAME "@APPLICATION_EXECUTABLE@"
  3. !define APPLICATION_NAME "@APPLICATION_NAME@"
  4. !define APPLICATION_VENDOR "@APPLICATION_VENDOR@"
  5. !define APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@.exe"
  6. !define APPLICATION_CMD_EXECUTABLE "@APPLICATION_EXECUTABLE@cmd.exe"
  7. !define APPLICATION_DOMAIN "@APPLICATION_DOMAIN@"
  8. !define APPLICATION_LICENSE "@APPLICATION_LICENSE@"
  9. !define WIN_SETUP_BITMAP_PATH "@WIN_SETUP_BITMAP_PATH@"
  10. !define CRASHREPORTER_EXECUTABLE "@CRASHREPORTER_EXECUTABLE@"
  11. ;-----------------------------------------------------------------------------
  12. ; Some installer script options (comment-out options not required)
  13. ;-----------------------------------------------------------------------------
  14. !if "@APPLICATION_LICENSE@" != ""
  15. !define OPTION_LICENSE_AGREEMENT
  16. !endif
  17. !define OPTION_UAC_PLUGIN_ENHANCED
  18. !define OPTION_SECTION_SC_SHELL_EXT
  19. !define OPTION_SECTION_SC_START_MENU
  20. !define OPTION_SECTION_SC_DESKTOP
  21. !define OPTION_SECTION_SC_QUICK_LAUNCH
  22. !define OPTION_FINISHPAGE
  23. !define OPTION_FINISHPAGE_LAUNCHER
  24. ; !define OPTION_FINISHPAGE_RELEASE_NOTES
  25. ;-----------------------------------------------------------------------------
  26. ; Some paths.
  27. ;-----------------------------------------------------------------------------
  28. !ifndef MING_PATH
  29. !define MING_PATH "/usr/i686-w64-mingw32/sys-root/mingw"
  30. !endif
  31. !define MING_BIN "${MING_PATH}/bin"
  32. !define MING_LIB "${MING_PATH}/lib"
  33. !define MING_SHARE "${MING_PATH}/share"
  34. !define BUILD_PATH "@CMAKE_BINARY_DIR@"
  35. !define SOURCE_PATH "@CMAKE_SOURCE_DIR@"
  36. !define QT_DLL_PATH "${MING_BIN}"
  37. !define ACCESSIBLE_DLL_PATH "${MING_LIB}/qt5/plugins/accessible"
  38. !define SQLITE_DLL_PATH "${MING_LIB}/qt5/plugins/sqldrivers"
  39. !define IMAGEFORMATS_DLL_PATH "${MING_LIB}/qt5/plugins/imageformats"
  40. !define PLATFORMS_DLL_PATH "${MING_LIB}/qt5/plugins/platforms"
  41. !define CSYNC_LIBRARY_DIR "@CSYNC_LIBRARY_DIR@"
  42. !define CSYNC_CONFIG_DIR "@CSYNC_CONFIG_DIR@"
  43. !define NSI_PATH "${source_path}/admin/win/nsi"
  44. ;-----------------------------------------------------------------------------
  45. ; Installer version
  46. ;-----------------------------------------------------------------------------
  47. !define VER_MAJOR "@CPACK_PACKAGE_VERSION_MAJOR@"
  48. !define VER_MINOR "@CPACK_PACKAGE_VERSION_MINOR@"
  49. !define VER_PATCH "@CPACK_PACKAGE_VERSION_PATCH@"
  50. !define VER_BUILD "@CPACK_PACKAGE_VERSION_BUILD@"
  51. !define VERSION "@CPACK_PACKAGE_VERSION@"
  52. Var InstallRunIfSilent
  53. Var NoAutomaticUpdates
  54. ;-----------------------------------------------------------------------------
  55. ; Installer build timestamp.
  56. ;-----------------------------------------------------------------------------
  57. !define /date BUILD_TIME "built on %Y/%m/%d at %I:%M %p"
  58. ;-----------------------------------------------------------------------------
  59. ; Initial installer setup and definitions.
  60. ;-----------------------------------------------------------------------------
  61. Name "@CPACK_NSIS_PACKAGE_NAME@"
  62. BrandingText "${APPLICATION_NAME} ${VERSION} -- ${BUILD_TIME}"
  63. OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@"
  64. InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
  65. InstallDirRegKey HKCU "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" ""
  66. InstType Standard
  67. InstType Full
  68. InstType Minimal
  69. CRCCheck On
  70. SetCompressor @CPACK_NSIS_COMPRESSOR@
  71. RequestExecutionLevel user ;Now using the UAC plugin.
  72. ReserveFile NSIS.InstallOptions.ini
  73. ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
  74. @CPACK_NSIS_SECTION_SELECTED_VARS@
  75. ;-----------------------------------------------------------------------------
  76. ; Include some required header files.
  77. ;-----------------------------------------------------------------------------
  78. !include LogicLib.nsh ;Used by APPDATA uninstaller.
  79. !include MUI2.nsh ;Used by APPDATA uninstaller.
  80. !include InstallOptions.nsh ;Required by MUI2 to support old MUI_INSTALLOPTIONS.
  81. !include Memento.nsh ;Remember user selections.
  82. !include WinVer.nsh ;Windows version detection.
  83. !include WordFunc.nsh ;Used by VersionCompare macro function.
  84. !include FileFunc.nsh ;Used to read out parameters
  85. !include UAC.nsh ;Used by the UAC elevation to install as user or admin.
  86. !include nsProcess.nsh ;Used to kill the running process
  87. !include Library.nsh ;Used by the COM registration for shell extensions
  88. !include x64.nsh ;Used to determine the right arch for the shell extensions
  89. ;-----------------------------------------------------------------------------
  90. ; Memento selections stored in registry.
  91. ;-----------------------------------------------------------------------------
  92. !define MEMENTO_REGISTRY_ROOT HKLM
  93. !define MEMENTO_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPLICATION_NAME}"
  94. ;-----------------------------------------------------------------------------
  95. ; Modern User Interface (MUI) definitions and setup.
  96. ;-----------------------------------------------------------------------------
  97. !define MUI_ABORTWARNING
  98. !define MUI_ICON ${NSI_PATH}\installer.ico
  99. !define MUI_UNICON ${NSI_PATH}\installer.ico
  100. !define MUI_WELCOMEFINISHPAGE_BITMAP ${WIN_SETUP_BITMAP_PATH}/welcome.bmp
  101. !define MUI_HEADERIMAGE
  102. !define MUI_HEADERIMAGE_BITMAP ${WIN_SETUP_BITMAP_PATH}/page_header.bmp
  103. !define MUI_COMPONENTSPAGE_SMALLDESC
  104. ; We removed this, h1 issue 191687
  105. ;!define MUI_FINISHPAGE_LINK "${APPLICATION_DOMAIN}"
  106. ;!define MUI_FINISHPAGE_LINK_LOCATION "http://${APPLICATION_DOMAIN}"
  107. !define MUI_FINISHPAGE_NOREBOOTSUPPORT
  108. !ifdef OPTION_FINISHPAGE_RELEASE_NOTES
  109. !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
  110. !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NOTES.txt"
  111. !define MUI_FINISHPAGE_SHOWREADME_TEXT $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING
  112. !endif
  113. !ifdef OPTION_FINISHPAGE_LAUNCHER
  114. !define MUI_FINISHPAGE_NOAUTOCLOSE
  115. !define MUI_FINISHPAGE_RUN
  116. !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchApplication"
  117. !endif
  118. ;-----------------------------------------------------------------------------
  119. ; Page macros.
  120. ;-----------------------------------------------------------------------------
  121. !insertmacro MUI_PAGE_WELCOME
  122. !ifdef OPTION_LICENSE_AGREEMENT
  123. !insertmacro MUI_PAGE_LICENSE "${APPLICATION_LICENSE}"
  124. !endif
  125. Page custom PageReinstall PageLeaveReinstall
  126. !insertmacro MUI_PAGE_COMPONENTS
  127. !insertmacro MUI_PAGE_DIRECTORY
  128. !insertmacro MUI_PAGE_INSTFILES
  129. !ifdef OPTION_FINISHPAGE
  130. !insertmacro MUI_PAGE_FINISH
  131. !endif
  132. !insertmacro MUI_UNPAGE_CONFIRM
  133. !insertmacro MUI_UNPAGE_INSTFILES
  134. ;-----------------------------------------------------------------------------
  135. ; Other MUI macros.
  136. ;-----------------------------------------------------------------------------
  137. !insertmacro MUI_LANGUAGE "English"
  138. !include ${source_path}/admin/win/nsi/l10n/languages.nsh
  139. !include ${source_path}/admin/win/nsi/l10n/declarations.nsh
  140. ; Set version strings with english locale
  141. VIProductVersion "${VERSION}"
  142. VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APPLICATION_NAME}"
  143. VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${APPLICATION_VENDOR}"
  144. VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VERSION}"
  145. !macro SETLANG un
  146. Function ${un}SetLang
  147. # load the selected language file
  148. !include "${source_path}/admin/win/nsi/l10n\English.nsh"
  149. StrCmp $LANGUAGE ${LANG_GERMAN} German 0
  150. StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
  151. StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
  152. StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
  153. StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
  154. StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
  155. StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
  156. StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
  157. StrCmp $LANGUAGE ${LANG_GREEK} Greek 0
  158. StrCmp $LANGUAGE ${LANG_BASQUE} Basque 0
  159. StrCmp $LANGUAGE ${LANG_GALICIAN} Galician 0
  160. StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
  161. StrCmp $LANGUAGE ${LANG_TURKISH} Turkish 0
  162. StrCmp $LANGUAGE ${LANG_NORWEGIAN} Norwegian 0
  163. StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
  164. German:
  165. !include "${source_path}/admin/win/nsi/l10n\German.nsh"
  166. Goto EndLanguageCmp
  167. Dutch:
  168. !include "${source_path}/admin/win/nsi/l10n\Dutch.nsh"
  169. Goto EndLanguageCmp
  170. Finnish:
  171. !include "${source_path}/admin/win/nsi/l10n\Finnish.nsh"
  172. Goto EndLanguageCmp
  173. Japanese:
  174. !include "${source_path}/admin/win/nsi/l10n\Japanese.nsh"
  175. Goto EndLanguageCmp
  176. Slovenian:
  177. !include "${source_path}/admin/win/nsi/l10n\Slovenian.nsh"
  178. Goto EndLanguageCmp
  179. Spanish:
  180. !include "${source_path}/admin/win/nsi/l10n\Spanish.nsh"
  181. Goto EndLanguageCmp
  182. Italian:
  183. !include "${source_path}/admin/win/nsi/l10n\Italian.nsh"
  184. Goto EndLanguageCmp
  185. Estonian:
  186. !include "${source_path}/admin/win/nsi/l10n\Estonian.nsh"
  187. Goto EndLanguageCmp
  188. Greek:
  189. !include "${source_path}/admin/win/nsi/l10n\Greek.nsh"
  190. Goto EndLanguageCmp
  191. Basque:
  192. !include "${source_path}/admin/win/nsi/l10n\Basque.nsh"
  193. Goto EndLanguageCmp
  194. Galician:
  195. !include "${source_path}/admin/win/nsi/l10n\Galician.nsh"
  196. Goto EndLanguageCmp
  197. Polish:
  198. !include "${source_path}/admin/win/nsi/l10n\Polish.nsh"
  199. Goto EndLanguageCmp
  200. Turkish:
  201. !include "${source_path}/admin/win/nsi/l10n\Turkish.nsh"
  202. Goto EndLanguageCmp
  203. Brazilian:
  204. !include "${source_path}/admin/win/nsi/l10n\PortugueseBR.nsh"
  205. Goto EndLanguageCmp
  206. Norwegian:
  207. !include "${source_path}/admin/win/nsi/l10n\Norwegian.nsh"
  208. EndLanguageCmp:
  209. FunctionEnd
  210. !macroend
  211. !insertmacro SETLANG ""
  212. !insertmacro SETLANG "un."
  213. ; Usage: ${If} ${HasSection} SectionName
  214. !macro _HasSection _a _b _t _f
  215. ReadRegDWORD $_LOGICLIB_TEMP "${MEMENTO_REGISTRY_ROOT}" "${MEMENTO_REGISTRY_KEY}" "MementoSection_${_b}"
  216. IntCmpU $_LOGICLIB_TEMP 0 ${_f} ${_t}
  217. !macroend
  218. !define HasSection `"" HasSection`
  219. ##############################################################################
  220. # #
  221. # FINISH PAGE LAUNCHER FUNCTIONS #
  222. # #
  223. ##############################################################################
  224. Function LaunchApplication
  225. !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\${APPLICATION_EXECUTABLE}" "" "" ""
  226. FunctionEnd
  227. ##############################################################################
  228. # #
  229. # PROCESS HANDLING FUNCTIONS AND MACROS #
  230. # #
  231. ##############################################################################
  232. !macro CheckForProcess processName gotoWhenFound gotoWhenNotFound
  233. ${nsProcess::FindProcess} ${processName} $R0
  234. StrCmp $R0 0 ${gotoWhenFound} ${gotoWhenNotFound}
  235. !macroend
  236. !macro ConfirmEndProcess processName
  237. MessageBox MB_YESNO|MB_ICONEXCLAMATION \
  238. $ConfirmEndProcess_MESSAGEBOX_TEXT \
  239. /SD IDYES IDYES process_${processName}_kill IDNO process_${processName}_ended
  240. process_${processName}_kill:
  241. DetailPrint $ConfirmEndProcess_KILLING_PROCESSES_TEXT
  242. ${nsProcess::KillProcess} ${processName} $R0
  243. Sleep 1500
  244. StrCmp $R0 "1" process_${processName}_ended
  245. DetailPrint $ConfirmEndProcess_KILL_NOT_FOUND_TEXT
  246. process_${processName}_ended:
  247. !macroend
  248. !macro CheckAndConfirmEndProcess processName
  249. !insertmacro CheckForProcess ${processName} 0 no_process_${processName}_to_end
  250. !insertmacro ConfirmEndProcess ${processName}
  251. no_process_${processName}_to_end:
  252. !macroend
  253. Function EnsureOwncloudShutdown
  254. !insertmacro CheckAndConfirmEndProcess "${APPLICATION_EXECUTABLE}"
  255. FunctionEnd
  256. Function InstallRedistributables
  257. ${If} ${RunningX64}
  258. ExecWait '"$OUTDIR\vcredist_x64.exe" /install /quiet'
  259. ${Else}
  260. ExecWait '"$OUTDIR\vcredist_x86.exe" /install /quiet'
  261. ${EndIf}
  262. Delete "$OUTDIR\vcredist_x86.exe"
  263. Delete "$OUTDIR\vcredist_x64.exe"
  264. FunctionEnd
  265. ##############################################################################
  266. # #
  267. # RE-INSTALLER FUNCTIONS #
  268. # #
  269. ##############################################################################
  270. Function PageReinstall
  271. ReadRegStr $R0 HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" ""
  272. StrCmp $R0 "" 0 +2
  273. Abort
  274. ;Detect version
  275. ReadRegDWORD $R0 HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionMajor"
  276. IntCmp $R0 ${VER_MAJOR} minor_check new_version older_version
  277. minor_check:
  278. ReadRegDWORD $R0 HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionMinor"
  279. IntCmp $R0 ${VER_MINOR} rev_check new_version older_version
  280. rev_check:
  281. ReadRegDWORD $R0 HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionRevision"
  282. IntCmp $R0 ${VER_PATCH} build_check new_version older_version
  283. build_check:
  284. ReadRegDWORD $R0 HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionBuild"
  285. IntCmp $R0 ${VER_BUILD} same_version new_version older_version
  286. new_version:
  287. !insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" $PageReinstall_NEW_Field_1
  288. !insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" $PageReinstall_NEW_Field_2
  289. !insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" $PageReinstall_NEW_Field_3
  290. !insertmacro MUI_HEADER_TEXT $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE
  291. StrCpy $R0 "1"
  292. Goto reinst_start
  293. older_version:
  294. !insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" $PageReinstall_OLD_Field_1
  295. !insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" $PageReinstall_NEW_Field_2
  296. !insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" $PageReinstall_NEW_Field_3
  297. !insertmacro MUI_HEADER_TEXT $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE
  298. StrCpy $R0 "1"
  299. Goto reinst_start
  300. same_version:
  301. !insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 1" "Text" $PageReinstall_SAME_Field_1
  302. !insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 2" "Text" $PageReinstall_SAME_Field_2
  303. !insertmacro INSTALLOPTIONS_WRITE "NSIS.InstallOptions.ini" "Field 3" "Text" $PageReinstall_SAME_Field_3
  304. !insertmacro MUI_HEADER_TEXT $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE
  305. StrCpy $R0 "2"
  306. reinst_start:
  307. !insertmacro INSTALLOPTIONS_DISPLAY "NSIS.InstallOptions.ini"
  308. FunctionEnd
  309. Function PageLeaveReinstall
  310. !insertmacro INSTALLOPTIONS_READ $R1 "NSIS.InstallOptions.ini" "Field 2" "State"
  311. StrCmp $R0 "1" 0 +2
  312. StrCmp $R1 "1" reinst_uninstall reinst_done
  313. StrCmp $R0 "2" 0 +3
  314. StrCmp $R1 "1" reinst_done reinst_uninstall
  315. reinst_uninstall:
  316. ReadRegStr $R1 ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "UninstallString"
  317. HideWindow
  318. ClearErrors
  319. ExecWait '$R1 _?=$INSTDIR'
  320. IfErrors no_remove_uninstaller
  321. IfFileExists "$INSTDIR\${APPLICATION_EXECUTABLE}" no_remove_uninstaller
  322. Delete $R1
  323. RMDir $INSTDIR
  324. no_remove_uninstaller:
  325. StrCmp $R0 "2" 0 +3
  326. Quit
  327. BringToFront
  328. reinst_done:
  329. FunctionEnd
  330. ##############################################################################
  331. # #
  332. # INSTALLER SECTIONS #
  333. # #
  334. ##############################################################################
  335. Section "${APPLICATION_NAME}" SEC_APPLICATION
  336. SectionIn 1 2 3 RO
  337. SetDetailsPrint listonly
  338. SetDetailsPrint textonly
  339. DetailPrint $SEC_APPLICATION_DETAILS
  340. SetDetailsPrint listonly
  341. SetOutPath "$INSTDIR"
  342. ;Main executable & csync
  343. File "${BUILD_PATH}\bin\${APPLICATION_EXECUTABLE}"
  344. File "${BUILD_PATH}\bin\${APPLICATION_CMD_EXECUTABLE}"
  345. File "${BUILD_PATH}\bin\lib${APPLICATION_SHORTNAME}sync.dll"
  346. File "${BUILD_PATH}\bin\libocsync.dll"
  347. File "${BUILD_PATH}\src\gui\client*.qm"
  348. ; Make sure only to copy qt, not qt_help, etc
  349. File "${MING_SHARE}\qt5\translations\qt_??.qm"
  350. File "${MING_SHARE}\qt5\translations\qt_??_??.qm"
  351. File "${MING_SHARE}\qt5\translations\qtbase_*.qm"
  352. File "${MING_SHARE}\qt5\translations\qtkeychain_*.qm"
  353. ;Add crash reporter if it was built
  354. File /nonfatal "${BUILD_PATH}/bin/${CRASHREPORTER_EXECUTABLE}.exe"
  355. SetOutPath "$INSTDIR\platforms"
  356. File "${PLATFORMS_DLL_PATH}\qwindows.dll"
  357. SetOutPath "$INSTDIR\imageformats"
  358. File "${IMAGEFORMATS_DLL_PATH}\qgif.dll"
  359. File "${IMAGEFORMATS_DLL_PATH}\qjpeg.dll"
  360. File "${IMAGEFORMATS_DLL_PATH}\qico.dll"
  361. SetOutPath "$INSTDIR\sqldrivers"
  362. File "${SQLITE_DLL_PATH}\qsqlite.dll"
  363. SetOutPath "$INSTDIR"
  364. ;License & release notes.
  365. File "@CPACK_RESOURCE_FILE_LICENSE@"
  366. ;File /oname=NOTES.txt ${NSI_PATH}\RELEASE_NOTES.txt
  367. ;Qt config:
  368. File "${NSI_PATH}\qt.conf"
  369. ;Qt stuff:
  370. File "${QT_DLL_PATH}\Qt5Core.dll"
  371. File "${QT_DLL_PATH}\Qt5Gui.dll"
  372. File "${QT_DLL_PATH}\Qt5Network.dll"
  373. File "${QT_DLL_PATH}\Qt5PrintSupport.dll"
  374. File "${QT_DLL_PATH}\Qt5Qml.dll"
  375. File "${QT_DLL_PATH}\Qt5Sql.dll"
  376. File "${QT_DLL_PATH}\Qt5WebKit.dll"
  377. File "${QT_DLL_PATH}\Qt5WebKitWidgets.dll"
  378. File "${QT_DLL_PATH}\Qt5Widgets.dll"
  379. File "${QT_DLL_PATH}\Qt5Xml.dll"
  380. ;QtWebKit dependencies
  381. File "${QT_DLL_PATH}\Qt5Multimedia.dll"
  382. File "${QT_DLL_PATH}\Qt5MultimediaWidgets.dll"
  383. File "${QT_DLL_PATH}\Qt5Sensors.dll"
  384. ;Qt deps
  385. File "${MING_BIN}\libpng16-16.dll"
  386. File "${MING_BIN}\icudata56.dll"
  387. File "${MING_BIN}\icui18n56.dll"
  388. File "${MING_BIN}\icuuc56.dll"
  389. File "${MING_BIN}\libEGL.dll"
  390. File "${MING_BIN}\libGLESv2.dll"
  391. File "${MING_BIN}\libjpeg-8.dll"
  392. File "${MING_BIN}\libpcre16-0.dll"
  393. File "${MING_BIN}\libsqlite3-0.dll"
  394. File "${MING_BIN}\libcrypto-10.dll"
  395. File "${MING_BIN}\libssl-10.dll"
  396. File "${MING_BIN}\libstdc++-6.dll"
  397. File "${MING_BIN}\libwebp-5.dll"
  398. File "${MING_BIN}\libxslt-1.dll"
  399. File "${MING_BIN}\libxml2-2.dll"
  400. File "${MING_BIN}\zlib1.dll"
  401. File "${MING_BIN}\libharfbuzz-0.dll"
  402. File "${MING_BIN}\libfreetype-6.dll"
  403. File "${MING_BIN}\libglib-2.0-0.dll"
  404. File "${MING_BIN}\libintl-8.dll"
  405. ;QtKeyChain stuff
  406. File "${MING_BIN}\libqt5keychain.dll"
  407. ;MinGW stuff
  408. File "${MING_BIN}\libgcc_s_sjlj-1.dll"
  409. File "${MING_BIN}\libstdc++-6.dll"
  410. File "${MING_BIN}\libwinpthread-1.dll"
  411. ;CSync configs
  412. File "${SOURCE_PATH}/sync-exclude.lst"
  413. SectionEnd
  414. !ifdef OPTION_SECTION_SC_SHELL_EXT
  415. ${MementoSection} $OPTION_SECTION_SC_SHELL_EXT_SECTION SEC_SHELL_EXT
  416. SectionIn 1 2
  417. SetDetailsPrint textonly
  418. DetailPrint $OPTION_SECTION_SC_SHELL_EXT_DetailPrint
  419. File "${BUILD_PATH}\vcredist_x86.exe"
  420. File "${BUILD_PATH}\vcredist_x64.exe"
  421. Call InstallRedistributables
  422. CreateDirectory "$INSTDIR\shellext"
  423. !define LIBRARY_COM
  424. !define LIBRARY_SHELL_EXTENSION
  425. !define LIBRARY_IGNORE_VERSION
  426. ${If} ${RunningX64}
  427. !define LIBRARY_X64
  428. !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCUtil_x64.dll" "$INSTDIR\shellext\OCUtil_x64.dll" "$INSTDIR\shellext"
  429. !insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCOverlays_x64.dll" "$INSTDIR\shellext\OCOverlays_x64.dll" "$INSTDIR\shellext"
  430. !insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCContextMenu_x64.dll" "$INSTDIR\shellext\OCContextMenu_x64.dll" "$INSTDIR\shellext"
  431. !undef LIBRARY_X64
  432. ${Else}
  433. !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCUtil_x86.dll" "$INSTDIR\shellext\OCUtil_x86.dll" "$INSTDIR\shellext"
  434. !insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCOverlays_x86.dll" "$INSTDIR\shellext\OCOverlays_x86.dll" "$INSTDIR\shellext"
  435. !insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCContextMenu_x86.dll" "$INSTDIR\shellext\OCContextMenu_x86.dll" "$INSTDIR\shellext"
  436. ${Endif}
  437. !undef LIBRARY_COM
  438. !undef LIBRARY_SHELL_EXTENSION
  439. !undef LIBRARY_IGNORE_VERSION
  440. ${MementoSectionEnd}
  441. !endif
  442. SectionGroup $SectionGroup_Shortcuts
  443. !ifdef OPTION_SECTION_SC_START_MENU
  444. ${MementoSection} $OPTION_SECTION_SC_START_MENU_SECTION SEC_START_MENU
  445. SectionIn 1 2 3
  446. SetDetailsPrint textonly
  447. DetailPrint $OPTION_SECTION_SC_START_MENU_DetailPrint
  448. SetDetailsPrint listonly
  449. SetShellVarContext all
  450. CreateShortCut "$SMPROGRAMS\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_EXECUTABLE}"
  451. SetShellVarContext current
  452. ${MementoSectionEnd}
  453. !endif
  454. !ifdef OPTION_SECTION_SC_DESKTOP
  455. ${MementoSection} $OPTION_SECTION_SC_DESKTOP_SECTION SEC_DESKTOP
  456. SectionIn 1 2
  457. SetDetailsPrint textonly
  458. DetailPrint $OPTION_SECTION_SC_DESKTOP_DetailPrint
  459. SetDetailsPrint listonly
  460. SetShellVarContext all
  461. CreateShortCut "$DESKTOP\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_EXECUTABLE}"
  462. SetShellVarContext current
  463. ${MementoSectionEnd}
  464. !endif
  465. !ifdef OPTION_SECTION_SC_QUICK_LAUNCH
  466. ${MementoSection} $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION SEC_QUICK_LAUNCH
  467. SectionIn 1 2
  468. SetDetailsPrint textonly
  469. DetailPrint $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint
  470. SetShellVarContext all
  471. SetDetailsPrint listonly
  472. CreateShortCut "$QUICKLAUNCH\${APPLICATION_NAME}.lnk" "$INSTDIR\${APPLICATION_EXECUTABLE}"
  473. SetShellVarContext current
  474. ${MementoSectionEnd}
  475. !endif
  476. SectionGroupEnd
  477. ${MementoSectionDone}
  478. ; Installer section descriptions
  479. ;--------------------------------
  480. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  481. !insertmacro MUI_DESCRIPTION_TEXT ${SEC_APPLICATION} $OPTION_SECTION_SC_APPLICATION_Desc
  482. !insertmacro MUI_DESCRIPTION_TEXT ${SEC_START_MENU} $OPTION_SECTION_SC_START_MENU_Desc
  483. !insertmacro MUI_DESCRIPTION_TEXT ${SEC_DESKTOP} $OPTION_SECTION_SC_DESKTOP_Desc
  484. !insertmacro MUI_DESCRIPTION_TEXT ${SEC_QUICK_LAUNCH} $OPTION_SECTION_SC_QUICK_LAUNCH_Desc
  485. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  486. Section -post
  487. ;Uninstaller file.
  488. SetDetailsPrint textonly
  489. DetailPrint $UNINSTALLER_FILE_Detail
  490. SetDetailsPrint listonly
  491. WriteUninstaller $INSTDIR\uninstall.exe
  492. ;Registry keys required for installer version handling and uninstaller.
  493. SetDetailsPrint textonly
  494. DetailPrint $UNINSTALLER_REGISTRY_Detail
  495. SetDetailsPrint listonly
  496. ;Version numbers used to detect existing installation version for comparison.
  497. WriteRegStr HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "" $INSTDIR
  498. WriteRegDWORD HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionMajor" "${VER_MAJOR}"
  499. WriteRegDWORD HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionMinor" "${VER_MINOR}"
  500. WriteRegDWORD HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionRevision" "${VER_PATCH}"
  501. WriteRegDWORD HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionBuild" "${VER_BUILD}"
  502. ;Add or Remove Programs entry.
  503. WriteRegExpandStr ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
  504. WriteRegExpandStr ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "InstallLocation" "$INSTDIR"
  505. WriteRegStr ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "DisplayName" "${APPLICATION_NAME}"
  506. WriteRegStr ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "Publisher" "${APPLICATION_VENDOR}"
  507. WriteRegStr ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "DisplayIcon" "$INSTDIR\Uninstall.exe,0"
  508. WriteRegStr ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "DisplayVersion" "${VERSION}"
  509. WriteRegDWORD ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "VersionMajor" "${VER_MAJOR}"
  510. WriteRegDWORD ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "VersionMinor" "${VER_MINOR}.${VER_PATCH}.${VER_BUILD}"
  511. WriteRegStr ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "URLInfoAbout" "http://${APPLICATION_DOMAIN}/"
  512. WriteRegStr ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "HelpLink" "http://${APPLICATION_DOMAIN}/"
  513. WriteRegDWORD ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "NoModify" "1"
  514. WriteRegDWORD ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "NoRepair" "1"
  515. SetDetailsPrint textonly
  516. DetailPrint $UNINSTALLER_FINISHED_Detail
  517. SectionEnd
  518. ##############################################################################
  519. # #
  520. # UNINSTALLER SECTION #
  521. # #
  522. ##############################################################################
  523. Function un.EnsureOwncloudShutdown
  524. !insertmacro CheckAndConfirmEndProcess "${APPLICATION_EXECUTABLE}"
  525. FunctionEnd
  526. Section Uninstall
  527. IfFileExists "$INSTDIR\${APPLICATION_EXECUTABLE}" owncloud_installed
  528. MessageBox MB_YESNO $UNINSTALL_MESSAGEBOX /SD IDYES IDYES owncloud_installed
  529. Abort $UNINSTALL_ABORT
  530. owncloud_installed:
  531. ;Delete registry keys.
  532. DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionBuild"
  533. DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionMajor"
  534. DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionMinor"
  535. DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionRevision"
  536. DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" ""
  537. DeleteRegKey HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}"
  538. DeleteRegKey HKCR "${APPLICATION_NAME}"
  539. ;Shell extension
  540. !ifdef OPTION_SECTION_SC_SHELL_EXT
  541. !define LIBRARY_COM
  542. !define LIBRARY_SHELL_EXTENSION
  543. !define LIBRARY_IGNORE_VERSION
  544. ${If} ${HasSection} SEC_SHELL_EXT
  545. DetailPrint "Uninstalling x64 overlay DLLs"
  546. !define LIBRARY_X64
  547. !insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR\shellext\OCContextMenu_x64.dll"
  548. !insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR\shellext\OCOverlays_x64.dll"
  549. !insertmacro UnInstallLib DLL NOTSHARED REBOOT_PROTECTED "$INSTDIR\shellext\OCUtil_x64.dll"
  550. !undef LIBRARY_X64
  551. DetailPrint "Uninstalling x86 overlay DLLs"
  552. !insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR\shellext\OCContextMenu_x86.dll"
  553. !insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR\shellext\OCOverlays_x86.dll"
  554. !insertmacro UnInstallLib DLL NOTSHARED REBOOT_PROTECTED "$INSTDIR\shellext\OCUtil_x86.dll"
  555. ${EndIf}
  556. !undef LIBRARY_COM
  557. !undef LIBRARY_SHELL_EXTENSION
  558. !undef LIBRARY_IGNORE_VERSION
  559. !endif
  560. ;Start menu shortcut
  561. !ifdef OPTION_SECTION_SC_START_MENU
  562. SetShellVarContext all
  563. ${If} ${HasSection} SEC_START_MENU
  564. Delete "$SMPROGRAMS\${APPLICATION_NAME}.lnk"
  565. ${EndIf}
  566. SetShellVarContext current
  567. !endif
  568. ;Desktop shortcut.
  569. !ifdef OPTION_SECTION_SC_DESKTOP
  570. ${If} ${HasSection} SEC_DESKTOP
  571. SetShellVarContext all
  572. ${If} ${FileExists} "$DESKTOP\${APPLICATION_NAME}.lnk"
  573. Delete "$DESKTOP\${APPLICATION_NAME}.lnk"
  574. ${EndIf}
  575. SetShellVarContext current
  576. ${EndIf}
  577. !endif
  578. ;Quick Launch shortcut.
  579. !ifdef OPTION_SECTION_SC_QUICK_LAUNCH
  580. ${If} ${HasSection} SEC_QUICK_LAUNCH
  581. SetShellVarContext all
  582. ${If} ${FileExists} "$QUICKLAUNCH\${APPLICATION_NAME}.lnk"
  583. Delete "$QUICKLAUNCH\${APPLICATION_NAME}.lnk"
  584. ${EndIf}
  585. SetShellVarContext current
  586. ${EndIf}
  587. !endif
  588. ;Remove all the Program Files.
  589. RMDir /r $INSTDIR
  590. DeleteRegKey ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}"
  591. SetDetailsPrint textonly
  592. DetailPrint $UNINSTALLER_FINISHED_Detail
  593. SectionEnd
  594. ##############################################################################
  595. # #
  596. # NSIS Installer Event Handler Functions #
  597. # #
  598. ##############################################################################
  599. Function .onInit
  600. SetOutPath $INSTDIR
  601. ${GetParameters} $R0
  602. ${GetOptions} $R0 "/launch" $R0
  603. ${IfNot} ${Errors}
  604. StrCpy $InstallRunIfSilent "yes"
  605. ${EndIf}
  606. ${GetParameters} $R0
  607. ${GetOptions} $R0 "/noautoupdate" $R0
  608. ${IfNot} ${Errors}
  609. StrCpy $NoAutomaticUpdates "yes"
  610. ${EndIf}
  611. !insertmacro INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
  612. ; uncomment this line if you want to see the language selection
  613. ;!insertmacro MUI_LANGDLL_DISPLAY
  614. Call SetLang
  615. ; Remove Quick Launch option from Windows 7, as no longer applicable - usually.
  616. ${IfNot} ${AtMostWinVista}
  617. SectionSetText ${SEC_QUICK_LAUNCH} $INIT_NO_QUICK_LAUNCH
  618. SectionSetFlags ${SEC_QUICK_LAUNCH} ${SF_RO}
  619. SectionSetInstTypes ${SEC_QUICK_LAUNCH} 0
  620. ${EndIf}
  621. ; Some people might have a shortcut called 'ownCloud' pointing elsewhere, see #356
  622. ; Unselect item and adjust text
  623. ${If} ${FileExists} "$DESKTOP\${APPLICATION_NAME}.lnk"
  624. SectionSetText ${SEC_DESKTOP} $INIT_NO_DESKTOP
  625. Push $0
  626. SectionSetFlags ${SEC_DESKTOP} 0
  627. SectionSetInstTypes ${SEC_DESKTOP} 0
  628. Pop $0
  629. ${EndIf}
  630. ${MementoSectionRestore}
  631. UAC_TryAgain:
  632. !insertmacro UAC_RunElevated
  633. ${Switch} $0
  634. ${Case} 0
  635. ${IfThen} $1 = 1 ${|} Quit ${|} ;we are the outer process, the inner process has done its work, we are done
  636. ${IfThen} $3 <> 0 ${|} ${Break} ${|} ;we are admin, let the show go on
  637. ${If} $1 = 3 ;RunAs completed successfully, but with a non-admin user
  638. MessageBox mb_YesNo|mb_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND $UAC_INSTALLER_REQUIRE_ADMIN /SD IDNO IDYES UAC_TryAgain IDNO 0
  639. ${EndIf}
  640. ;fall-through and die
  641. ${Case} 1223
  642. MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND $UAC_INSTALLER_REQUIRE_ADMIN
  643. Quit
  644. ${Case} 1062
  645. MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND $UAC_ERROR_LOGON_SERVICE
  646. Quit
  647. ${Default}
  648. MessageBox MB_ICONSTOP "$UAC_ERROR_ELEVATE $0"
  649. Abort
  650. Quit
  651. ${EndSwitch}
  652. ;Prevent multiple instances.
  653. System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${APPLICATION_SHORTNAME}Installer") i .r1 ?e'
  654. Pop $R0
  655. StrCmp $R0 0 +3
  656. MessageBox MB_OK|MB_ICONEXCLAMATION $INIT_INSTALLER_RUNNING
  657. Abort
  658. ;Use available InstallLocation when possible. This is useful in the uninstaller
  659. ;via re-install, which would otherwise use a default location - a bug.
  660. ReadRegStr $R0 ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "InstallLocation"
  661. StrCmp $R0 "" SkipSetInstDir
  662. StrCpy $INSTDIR $R0
  663. SkipSetInstDir:
  664. ;Shutdown ${APPLICATION_NAME} in case Add/Remove re-installer option used.
  665. Call EnsureOwncloudShutdown
  666. ReadRegStr $R0 ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "InstallLocation"
  667. ${If} ${Silent}
  668. ${AndIf} $R0 != ""
  669. ExecWait '"$R0\Uninstall.exe" /S _?=$R0'
  670. ${EndIf}
  671. FunctionEnd
  672. Function .onInstSuccess
  673. ${MementoSectionSave}
  674. ${If} $NoAutomaticUpdates == "yes"
  675. WriteRegDWORD HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "skipUpdateCheck" "1"
  676. ${EndIf}
  677. ; TODO: Only needed to when updating from 2.1.{0,1}. Remove in due time.
  678. Delete /REBOOTOK $INSTDIR\bearer\qgenericbearer.dll
  679. Delete /REBOOTOK $INSTDIR\bearer\qnativewifibearer.dll
  680. RMDir /REBOOTOK $INSTDIR\bearer
  681. ${If} ${Silent}
  682. ${AndIf} $InstallRunIfSilent == "yes"
  683. Call LaunchApplication
  684. ${EndIf}
  685. FunctionEnd
  686. Function .onInstFailed
  687. FunctionEnd
  688. ##############################################################################
  689. # #
  690. # NSIS Uninstaller Event Handler Functions #
  691. # #
  692. ##############################################################################
  693. Function un.onInit
  694. Call un.SetLang
  695. UAC_TryAgain:
  696. !insertmacro UAC_RunElevated
  697. ${Switch} $0
  698. ${Case} 0
  699. ${IfThen} $1 = 1 ${|} Quit ${|} ;we are the outer process, the inner process has done its work, we are done
  700. ${IfThen} $3 <> 0 ${|} ${Break} ${|} ;we are admin, let the show go on
  701. ${If} $1 = 3 ;RunAs completed successfully, but with a non-admin user
  702. MessageBox mb_YesNo|mb_ICONEXCLAMATION|MB_TOPMOST|MB_SETFOREGROUND $UAC_UNINSTALLER_REQUIRE_ADMIN /SD IDNO IDYES UAC_TryAgain IDNO 0
  703. ${EndIf}
  704. ;fall-through and die
  705. ${Case} 1223
  706. MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND $UAC_UNINSTALLER_REQUIRE_ADMIN
  707. Quit
  708. ${Case} 1062
  709. MessageBox MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND $UAC_ERROR_LOGON_SERVICE
  710. Quit
  711. ${Default}
  712. MessageBox MB_ICONSTOP "$UAC_ERROR_ELEVATE $0"
  713. Abort
  714. Quit
  715. ${EndSwitch}
  716. ;Prevent multiple instances.
  717. System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${APPLICATION_SHORTNAME}Uninstaller") i .r1 ?e'
  718. Pop $R0
  719. StrCmp $R0 0 +3
  720. MessageBox MB_OK|MB_ICONEXCLAMATION $INIT_UNINSTALLER_RUNNING
  721. Abort
  722. ;Shutdown ${APPLICATION_NAME} in order to remove locked files.
  723. Call un.EnsureOwncloudShutdown
  724. FunctionEnd
  725. Function un.onUnInstSuccess
  726. FunctionEnd
  727. Function un.onUnInstFailed
  728. FunctionEnd