jellyfin.nsi 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. ; Shows a lot of debug information while compiling
  2. ; This can be removed once stable.
  3. !verbose 4
  4. SetCompressor lzma
  5. ShowInstDetails show
  6. ShowUninstDetails show
  7. ;--------------------------------
  8. !define SF_USELECTED 0 ; used to check selected options status, rest are inherited from Sections.nsh
  9. !include "MUI2.nsh"
  10. !include "Sections.nsh"
  11. !include "LogicLib.nsh"
  12. !include "helpers\ShowError.nsh"
  13. ; Global variables that we'll use
  14. Var _JELLYFINVERSION_
  15. Var _JELLYFINDATADIR_
  16. Var _INSTALLSERVICE_
  17. Var _SERVICESTART_
  18. Var _SERVICEACCOUNTTYPE_
  19. Var _EXISTINGINSTALLATION_
  20. Var _EXISTINGSERVICE_
  21. ;
  22. !ifdef x64
  23. !define ARCH "x64"
  24. !define NAMESUFFIX "(64 bit)"
  25. !define INSTALL_DIRECTORY "$PROGRAMFILES64\Jellyfin\Server"
  26. !endif
  27. !ifdef x84
  28. !define ARCH "x86"
  29. !define NAMESUFFIX "(32 bit)"
  30. !define INSTALL_DIRECTORY "$PROGRAMFILES32\Jellyfin\Server"
  31. !endif
  32. !ifndef ARCH
  33. !error "Set the Arch with /Dx86 or /Dx64"
  34. !endif
  35. ;--------------------------------
  36. !define REG_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\JellyfinServer" ;Registry to show up in Add/Remove Programs
  37. !define REG_CONFIG_KEY "Software\Jellyfin\Server" ;Registry to store all configuration
  38. !getdllversion "$%InstallLocation%\jellyfin.dll" ver_ ;Align installer version with jellyfin.dll version
  39. Name "Jellyfin Server ${ver_1}.${ver_2}.${ver_3} ${NAMESUFFIX}" ; This is referred in various header text labels
  40. OutFile "jellyfin_${ver_1}.${ver_2}.${ver_3}_windows-${ARCH}.exe" ; Naming convention jellyfin_{version}_windows-{arch].exe
  41. BrandingText "Jellyfin Server ${ver_1}.${ver_2}.${ver_3} Installer" ; This shows in just over the buttons
  42. ; installer attributes, these show up in details tab on installer properties
  43. VIProductVersion "${ver_1}.${ver_2}.${ver_3}.0" ; VIProductVersion format, should be X.X.X.X
  44. VIFileVersion "${ver_1}.${ver_2}.${ver_3}.0" ; VIFileVersion format, should be X.X.X.X
  45. VIAddVersionKey "ProductName" "Jellyfin Server"
  46. VIAddVersionKey "FileVersion" "${ver_1}.${ver_2}.${ver_3}.0"
  47. VIAddVersionKey "LegalCopyright" "(c) 2019 Jellyfin Contributors. Code released under the GNU General Public License"
  48. VIAddVersionKey "FileDescription" "Jellyfin Server: The Free Software Media System"
  49. ;TODO, check defaults
  50. InstallDir ${INSTALL_DIRECTORY} ;Default installation folder
  51. InstallDirRegKey HKLM "${REG_CONFIG_KEY}" "InstallFolder" ;Read the registry for install folder,
  52. RequestExecutionLevel admin ; ask it upfront for service control, and installing in priv folders
  53. CRCCheck on ; make sure the installer wasn't corrupted while downloading
  54. !define MUI_ABORTWARNING ;Prompts user in case of aborting install
  55. ; TODO: Replace with nice Jellyfin Icons
  56. !ifdef UXPATH
  57. !define MUI_ICON "${UXPATH}\branding\NSIS\modern-install.ico" ; Installer Icon
  58. !define MUI_UNICON "${UXPATH}\branding\NSIS\modern-uninstall.ico" ; Uninstaller Icon
  59. !define MUI_HEADERIMAGE
  60. !define MUI_HEADERIMAGE_BITMAP "${UXPATH}\branding\NSIS\installer-header.bmp"
  61. !define MUI_WELCOMEFINISHPAGE_BITMAP "${UXPATH}\branding\NSIS\installer-right.bmp"
  62. !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${UXPATH}\branding\NSIS\installer-right.bmp"
  63. !endif
  64. ;--------------------------------
  65. ;Pages
  66. ; Welcome Page
  67. !define MUI_WELCOMEPAGE_TEXT "The installer will ask for details to install Jellyfin Server."
  68. !insertmacro MUI_PAGE_WELCOME
  69. ; License Page
  70. !insertmacro MUI_PAGE_LICENSE "$%InstallLocation%\LICENSE" ; picking up generic GPL
  71. ; Components Page
  72. !insertmacro MUI_PAGE_COMPONENTS
  73. !define MUI_PAGE_CUSTOMFUNCTION_PRE HideInstallDirectoryPage ; Controls when to hide / show
  74. !define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Install folder" ; shows just above the folder selection dialog
  75. !insertmacro MUI_PAGE_DIRECTORY
  76. ; Data folder Page
  77. !define MUI_PAGE_CUSTOMFUNCTION_PRE HideDataDirectoryPage ; Controls when to hide / show
  78. !define MUI_PAGE_HEADER_TEXT "Choose Data Location"
  79. !define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install the Jellyfin Server data."
  80. !define MUI_DIRECTORYPAGE_TEXT_TOP "The installer will set the following folder for Jellyfin Server data. To install in a different folder, click Browse and select another folder. Please make sure the folder exists and is accessible. Click Next to continue."
  81. !define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Data folder"
  82. !define MUI_DIRECTORYPAGE_VARIABLE $_JELLYFINDATADIR_
  83. !insertmacro MUI_PAGE_DIRECTORY
  84. ; Custom Dialogs
  85. !include "dialogs\service-config.nsdinc"
  86. !include "dialogs\confirmation.nsdinc"
  87. ; Select service account type
  88. #!define MUI_PAGE_CUSTOMFUNCTION_PRE HideServiceConfigPage ; Controls when to hide / show (This does not work for Page, might need to go PageEx)
  89. #!define MUI_PAGE_CUSTOMFUNCTION_SHOW fnc_service_config_Show
  90. #!define MUI_PAGE_CUSTOMFUNCTION_LEAVE ServiceConfigPage_Config
  91. #!insertmacro MUI_PAGE_CUSTOM ServiceAccountType
  92. Page custom ShowServiceConfigPage ServiceConfigPage_Config
  93. ; Confirmation Page
  94. Page custom ShowConfirmationPage ; just letting the user know what they chose to install
  95. ; Actual Installion Page
  96. !insertmacro MUI_PAGE_INSTFILES
  97. !insertmacro MUI_UNPAGE_CONFIRM
  98. !insertmacro MUI_UNPAGE_INSTFILES
  99. #!insertmacro MUI_UNPAGE_FINISH
  100. ;--------------------------------
  101. ;Languages; Add more languages later here if needed
  102. !insertmacro MUI_LANGUAGE "English"
  103. ;--------------------------------
  104. ;Installer Sections
  105. Section "!Jellyfin Server (required)" InstallJellyfinServer
  106. SectionIn RO ; Mandatory section, isn't this the whole purpose to run the installer.
  107. StrCmp "$_EXISTINGINSTALLATION_" "Yes" RunUninstaller CarryOn ; Silently uninstall in case of previous installation
  108. RunUninstaller:
  109. DetailPrint "Looking for uninstaller at $INSTDIR"
  110. FindFirst $0 $1 "$INSTDIR\Uninstall.exe"
  111. FindClose $0
  112. StrCmp $1 "" CarryOn ; the registry key was there but uninstaller was not found
  113. DetailPrint "Silently running the uninstaller at $INSTDIR"
  114. ExecWait '"$INSTDIR\Uninstall.exe" /S _?=$INSTDIR' $0
  115. DetailPrint "Uninstall finished, $0"
  116. CarryOn:
  117. ${If} $_EXISTINGSERVICE_ == 'Yes'
  118. ExecWait '"$INSTDIR\nssm.exe" stop JellyfinServer' $0
  119. ${If} $0 <> 0
  120. MessageBox MB_OK|MB_ICONSTOP "Could not stop the Jellyfin Server service."
  121. Abort
  122. ${EndIf}
  123. DetailPrint "Stopped Jellyfin Server service, $0"
  124. ${EndIf}
  125. SetOutPath "$INSTDIR"
  126. File /r $%InstallLocation%\*
  127. ; Write the InstallFolder, DataFolder, Network Service info into the registry for later use
  128. WriteRegExpandStr HKLM "${REG_CONFIG_KEY}" "InstallFolder" "$INSTDIR"
  129. WriteRegExpandStr HKLM "${REG_CONFIG_KEY}" "DataFolder" "$_JELLYFINDATADIR_"
  130. WriteRegStr HKLM "${REG_CONFIG_KEY}" "ServiceAccountType" "$_SERVICEACCOUNTTYPE_"
  131. !getdllversion "$%InstallLocation%\jellyfin.dll" ver_
  132. StrCpy $_JELLYFINVERSION_ "${ver_1}.${ver_2}.${ver_3}" ;
  133. ; Write the uninstall keys for Windows
  134. WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayName" "Jellyfin Server $_JELLYFINVERSION_ ${NAMESUFFIX}"
  135. WriteRegExpandStr HKLM "${REG_UNINST_KEY}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
  136. WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayIcon" '"$INSTDIR\Uninstall.exe",0'
  137. WriteRegStr HKLM "${REG_UNINST_KEY}" "Publisher" "The Jellyfin Project"
  138. WriteRegStr HKLM "${REG_UNINST_KEY}" "URLInfoAbout" "https://jellyfin.media/"
  139. WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayVersion" "$_JELLYFINVERSION_"
  140. WriteRegDWORD HKLM "${REG_UNINST_KEY}" "NoModify" 1
  141. WriteRegDWORD HKLM "${REG_UNINST_KEY}" "NoRepair" 1
  142. ;Create uninstaller
  143. WriteUninstaller "$INSTDIR\Uninstall.exe"
  144. SectionEnd
  145. Section "Jellyfin Server Service" InstallService
  146. ExecWait '"$INSTDIR\nssm.exe" statuscode JellyfinServer' $0
  147. DetailPrint "Jellyfin Server service statuscode, $0"
  148. ${If} $0 == 0
  149. InstallRetry:
  150. ExecWait '"$INSTDIR\nssm.exe" install JellyfinServer "$INSTDIR\jellyfin.exe" --datadir \"$_JELLYFINDATADIR_\"' $0
  151. ${If} $0 <> 0
  152. !insertmacro ShowError "Could not install the Jellyfin Server service." InstallRetry
  153. ${EndIf}
  154. DetailPrint "Jellyfin Server Service install, $0"
  155. ${Else}
  156. DetailPrint "Jellyfin Server Service exists, updating..."
  157. ConfigureApplicationRetry:
  158. ExecWait '"$INSTDIR\nssm.exe" set JellyfinServer Application "$INSTDIR\jellyfin.exe"' $0
  159. ${If} $0 <> 0
  160. !insertmacro ShowError "Could not configure the Jellyfin Server service." ConfigureApplicationRetry
  161. ${EndIf}
  162. DetailPrint "Jellyfin Server Service setting (Application), $0"
  163. ConfigureAppParametersRetry:
  164. ExecWait '"$INSTDIR\nssm.exe" set JellyfinServer AppParameters --datadir \"$_JELLYFINDATADIR_\"' $0
  165. ${If} $0 <> 0
  166. !insertmacro ShowError "Could not configure the Jellyfin Server service." ConfigureAppParametersRetry
  167. ${EndIf}
  168. DetailPrint "Jellyfin Server Service setting (AppParameters), $0"
  169. ${EndIf}
  170. Sleep 3000 ; Give time for Windows to catchup
  171. ConfigureStartRetry:
  172. ExecWait '"$INSTDIR\nssm.exe" set JellyfinServer Start SERVICE_DELAYED_AUTO_START' $0
  173. ${If} $0 <> 0
  174. !insertmacro ShowError "Could not configure the Jellyfin Server service." ConfigureStartRetry
  175. ${EndIf}
  176. DetailPrint "Jellyfin Server Service setting (Start), $0"
  177. ConfigureDescriptionRetry:
  178. ExecWait '"$INSTDIR\nssm.exe" set JellyfinServer Description "Jellyfin Server: The Free Software Media System"' $0
  179. ${If} $0 <> 0
  180. !insertmacro ShowError "Could not configure the Jellyfin Server service." ConfigureDescriptionRetry
  181. ${EndIf}
  182. DetailPrint "Jellyfin Server Service setting (Description), $0"
  183. ConfigureDisplayNameRetry:
  184. ExecWait '"$INSTDIR\nssm.exe" set JellyfinServer DisplayName "Jellyfin Server"' $0
  185. ${If} $0 <> 0
  186. !insertmacro ShowError "Could not configure the Jellyfin Server service." ConfigureDisplayNameRetry
  187. ${EndIf}
  188. DetailPrint "Jellyfin Server Service setting (DisplayName), $0"
  189. Sleep 3000
  190. ${If} $_SERVICEACCOUNTTYPE_ == "NetworkService" ; the default install using NSSM is Local System
  191. ConfigureNetworkServiceRetry:
  192. ExecWait '"$INSTDIR\nssm.exe" set JellyfinServer Objectname "Network Service"' $0
  193. ${If} $0 <> 0
  194. !insertmacro ShowError "Could not configure the Jellyfin Server service account." ConfigureNetworkServiceRetry
  195. ${EndIf}
  196. DetailPrint "Jellyfin Server service account change, $0"
  197. ${EndIf}
  198. SectionEnd
  199. Section "-start service" StartService
  200. ${If} $_SERVICESTART_ == "Yes"
  201. ${AndIf} $_INSTALLSERVICE_ == "Yes"
  202. StartRetry:
  203. ExecWait '"$INSTDIR\nssm.exe" start JellyfinServer' $0
  204. ${If} $0 <> 0
  205. !insertmacro ShowError "Could not start the Jellyfin Server service." StartRetry
  206. ${EndIf}
  207. DetailPrint "Jellyfin Server service start, $0"
  208. ${EndIf}
  209. SectionEnd
  210. ;--------------------------------
  211. ;Descriptions
  212. ;Language strings
  213. LangString DESC_InstallJellyfinServer ${LANG_ENGLISH} "Install Jellyfin Server"
  214. LangString DESC_InstallService ${LANG_ENGLISH} "Install As a Service"
  215. ;Assign language strings to sections
  216. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  217. !insertmacro MUI_DESCRIPTION_TEXT ${InstallJellyfinServer} $(DESC_InstallJellyfinServer)
  218. !insertmacro MUI_DESCRIPTION_TEXT ${InstallService} $(DESC_InstallService)
  219. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  220. ;--------------------------------
  221. ;Uninstaller Section
  222. Section "Uninstall"
  223. ReadRegStr $INSTDIR HKLM "${REG_CONFIG_KEY}" "InstallFolder" ; read the installation folder
  224. ReadRegStr $_JELLYFINDATADIR_ HKLM "${REG_CONFIG_KEY}" "DataFolder" ; read the data folder
  225. DetailPrint "Jellyfin Install location: $INSTDIR"
  226. DetailPrint "Jellyfin Data folder: $_JELLYFINDATADIR_"
  227. MessageBox MB_YESNO|MB_ICONINFORMATION "Do you want to retain the Jellyfin Server data folder? The media will not be touched. $\r$\nIf unsure choose YES." /SD IDYES IDYES PreserveData
  228. RMDir /r /REBOOTOK "$_JELLYFINDATADIR_"
  229. PreserveData:
  230. ExecWait '"$INSTDIR\nssm.exe" statuscode JellyfinServer' $0
  231. DetailPrint "Jellyfin Server service statuscode, $0"
  232. IntCmp $0 0 NoServiceUninstall ; service doesn't exist, may be run from desktop shortcut
  233. Sleep 3000 ; Give time for Windows to catchup
  234. UninstallStopRetry:
  235. ExecWait '"$INSTDIR\nssm.exe" stop JellyfinServer' $0
  236. ${If} $0 <> 0
  237. !insertmacro ShowError "Could not stop the Jellyfin Server service." UninstallStopRetry
  238. ${EndIf}
  239. DetailPrint "Stopped Jellyfin Server service, $0"
  240. UninstallRemoveRetry:
  241. ExecWait '"$INSTDIR\nssm.exe" remove JellyfinServer confirm' $0
  242. ${If} $0 <> 0
  243. !insertmacro ShowError "Could not remove the Jellyfin Server service." UninstallRemoveRetry
  244. ${EndIf}
  245. DetailPrint "Removed Jellyfin Server service, $0"
  246. Sleep 3000 ; Give time for Windows to catchup
  247. NoServiceUninstall: ; existing install was present but no service was detected
  248. Delete "$INSTDIR\*.*"
  249. RMDir /r /REBOOTOK "$INSTDIR\jellyfin-web"
  250. Delete "$INSTDIR\Uninstall.exe"
  251. RMDir /r /REBOOTOK "$INSTDIR"
  252. DeleteRegKey HKLM "Software\Jellyfin"
  253. DeleteRegKey HKLM "${REG_UNINST_KEY}"
  254. SectionEnd
  255. Function .onInit
  256. ; Setting up defaults
  257. StrCpy $_INSTALLSERVICE_ "Yes"
  258. StrCpy $_SERVICESTART_ "Yes"
  259. StrCpy $_SERVICEACCOUNTTYPE_ "NetworkService"
  260. StrCpy $_EXISTINGINSTALLATION_ "No"
  261. StrCpy $_EXISTINGSERVICE_ "No"
  262. SetShellVarContext current
  263. StrCpy $_JELLYFINDATADIR_ "$%ProgramData%\Jellyfin\Server"
  264. System::Call 'kernel32::CreateMutex(p 0, i 0, t "JellyfinServerMutex") p .r1 ?e'
  265. Pop $R0
  266. StrCmp $R0 0 +3
  267. !insertmacro ShowErrorFinal "The installer is already running."
  268. ;Detect if Jellyfin is already installed.
  269. ; In case it is installed, let the user choose either
  270. ; 1. Exit installer
  271. ; 2. Upgrade without messing with data
  272. ; 2a. Don't ask for any details, uninstall and install afresh with old settings
  273. ; Read Registry for previous installation
  274. ClearErrors
  275. ReadRegStr "$0" HKLM "${REG_CONFIG_KEY}" "InstallFolder"
  276. IfErrors NoExisitingInstall
  277. DetailPrint "Existing Jellyfin Server detected at: $0"
  278. StrCpy "$INSTDIR" "$0" ; set the location fro registry as new default
  279. StrCpy $_EXISTINGINSTALLATION_ "Yes" ; Set our flag to be used later
  280. SectionSetText ${InstallJellyfinServer} "Upgrade Jellyfin Server (required)" ; Change install text to "Upgrade"
  281. ; check if there is a service called Jellyfin, there should be
  282. ; hack : nssm statuscode Jellyfin will return non zero return code in case it exists
  283. ExecWait '"$INSTDIR\nssm.exe" statuscode JellyfinServer' $0
  284. DetailPrint "Jellyfin Server service statuscode, $0"
  285. IntCmp $0 0 NoService ; service doesn't exist, may be run from desktop shortcut
  286. ; if service was detected, set defaults going forward.
  287. StrCpy $_EXISTINGSERVICE_ "Yes"
  288. StrCpy $_INSTALLSERVICE_ "Yes"
  289. StrCpy $_SERVICESTART_ "Yes"
  290. ; check if service was run using Network Service account
  291. ClearErrors
  292. ReadRegStr $_SERVICEACCOUNTTYPE_ HKLM "${REG_CONFIG_KEY}" "ServiceAccountType" ; in case of error _SERVICEACCOUNTTYPE_ will be NetworkService as default
  293. ClearErrors
  294. ReadRegStr $_JELLYFINDATADIR_ HKLM "${REG_CONFIG_KEY}" "DataFolder" ; in case of error, the default holds
  295. ; Hide sections which will not be needed in case of previous install
  296. ; SectionSetText ${InstallService} ""
  297. NoService: ; existing install was present but no service was detected
  298. ; Let the user know that we'll upgrade and provide an option to quit.
  299. MessageBox MB_OKCANCEL|MB_ICONINFORMATION "Existing installation of Jellyfin Server was detected, it'll be upgraded, settings will be retained. \
  300. $\r$\nClick OK to proceed, Cancel to exit installer." /SD IDOK IDOK ProceedWithUpgrade
  301. Quit ; Quit if the user is not sure about upgrade
  302. ProceedWithUpgrade:
  303. NoExisitingInstall:
  304. ; by this time, the variables have been correctly set to reflect previous install details
  305. FunctionEnd
  306. Function HideInstallDirectoryPage
  307. ${If} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder
  308. Abort
  309. ${EndIf}
  310. FunctionEnd
  311. Function HideDataDirectoryPage
  312. ${If} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder
  313. Abort
  314. ${EndIf}
  315. FunctionEnd
  316. Function HideServiceConfigPage
  317. ${If} $_INSTALLSERVICE_ == "No" ; Not running as a service, don't ask for service type
  318. ${OrIf} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder
  319. Abort
  320. ${EndIf}
  321. FunctionEnd
  322. Function HideConfirmationPage
  323. ${If} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder
  324. Abort
  325. ${EndIf}
  326. FunctionEnd
  327. ; Service Config dialog show function
  328. Function ShowServiceConfigPage
  329. Call HideServiceConfigPage
  330. Call fnc_service_config_Create
  331. nsDialogs::Show
  332. FunctionEnd
  333. ; Confirmation dialog show function
  334. Function ShowConfirmationPage
  335. Call HideConfirmationPage
  336. Call fnc_confirmation_Create
  337. nsDialogs::Show
  338. FunctionEnd
  339. ; Declare temp variables to read the options from the custom page.
  340. Var StartServiceAfterInstall
  341. Var UseNetworkServiceAccount
  342. Var UseLocalSystemAccount
  343. Function ServiceConfigPage_Config
  344. ${NSD_GetState} $hCtl_service_config_StartServiceAfterInstall $StartServiceAfterInstall
  345. ${If} $StartServiceAfterInstall == 1
  346. StrCpy $_SERVICESTART_ "Yes"
  347. ${Else}
  348. StrCpy $_SERVICESTART_ "No"
  349. ${EndIf}
  350. ${NSD_GetState} $hCtl_service_config_UseNetworkServiceAccount $UseNetworkServiceAccount
  351. ${NSD_GetState} $hCtl_service_config_UseLocalSystemAccount $UseLocalSystemAccount
  352. ${If} $UseNetworkServiceAccount == 1
  353. StrCpy $_SERVICEACCOUNTTYPE_ "NetworkService"
  354. ${ElseIf} $UseLocalSystemAccount == 1
  355. StrCpy $_SERVICEACCOUNTTYPE_ "LocalSystem"
  356. ${Else}
  357. !insertmacro ShowErrorFinal "Service account type not properly configured."
  358. ${EndIf}
  359. FunctionEnd
  360. ; This function handles the choices during component selection
  361. Function .onSelChange
  362. ; If we are not installing service, we don't need to set the NetworkService account or StartService
  363. SectionGetFlags ${InstallService} $0
  364. ${If} $0 = ${SF_SELECTED}
  365. StrCpy $_INSTALLSERVICE_ "Yes"
  366. ${Else}
  367. StrCpy $_INSTALLSERVICE_ "No"
  368. StrCpy $_SERVICESTART_ "No"
  369. StrCpy $_SERVICEACCOUNTTYPE_ "None"
  370. ${EndIf}
  371. FunctionEnd
  372. Function .onInstSuccess
  373. #ExecShell "open" "http://localhost:8096"
  374. FunctionEnd