NSIS.template.in 34 KB

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