diff options
| author | crankdoofus <52436708+crankdoofus@users.noreply.github.com> | 2019-07-06 18:34:48 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-06 18:34:48 +1000 |
| commit | cea6a2217ecf1aaa7e1cb59bc90c2867f68dda7a (patch) | |
| tree | 05225deeb91ae155ea4e8187b12fe51cdd8f8305 | |
| parent | dc3eceec6a4be9c382cebfe22d8f820dfec5b4af (diff) | |
Correct Service handling & LocalAppData folder
The service is now completely controlled by nssm as with the install-jellyfin.ps1
The LocalAppData had the global context, its now
Corrected order of Mandatory and Optional components.
| -rw-r--r-- | deployment/windows/jellyfin.nsi | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/deployment/windows/jellyfin.nsi b/deployment/windows/jellyfin.nsi index 6187cf9fd..57008a608 100644 --- a/deployment/windows/jellyfin.nsi +++ b/deployment/windows/jellyfin.nsi @@ -70,6 +70,8 @@ Section "Install Jellyfin (required)" InstallJellyfin SetOutPath "$INSTDIR" + SetShellVarContext current + StrCpy $_JELLYFINDATADIR_ "$LOCALAPPDATA\jellyfin\" ; Pack all the files that were just compiled File /r $%InstallLocation%\* @@ -92,31 +94,27 @@ Section "Install Jellyfin (required)" InstallJellyfin SectionEnd -;TODO -; This section hasn't been tested completely +Section "Jellyfin desktop shortcut" DesktopShortcut + SetShellVarContext current + DetailPrint "Creating desktop shortcut" + CreateShortCut "$DESKTOP\Jellyfin.lnk" "$INSTDIR\jellyfin.exe" +SectionEnd + Section /o "Jellyfin Service" InstallService - ExecWait '"$INSTDIR"\nssm.exe install Jellyfin "$INSTDIR"\jellyfin.exe --datadir "$_JELLYFINDATADIR_"' $0 + ExecWait '"$INSTDIR\nssm.exe" install Jellyfin "$INSTDIR\jellyfin.exe" --datadir "$_JELLYFINDATADIR_"' $0 DetailPrint "Jellyfin Service install, $0" Sleep 3000 - ExecWait '"$INSTDIR"\nssm.exe set Jellyfin Start SERVICE_DELAYED_AUTO_START' $0 + ExecWait '"$INSTDIR\nssm.exe" set Jellyfin Start SERVICE_DELAYED_AUTO_START' $0 DetailPrint "Jellyfin Service setting, $0" StrCpy $_SERVICEINSTALLED_ "YES" SectionEnd -Section "Jellyfin desktop shortcut" DesktopShortcut - SetShellVarContext current - DetailPrint "Creating desktop shortcut" - CreateShortCut "$DESKTOP\Jellyfin.lnk" "$INSTDIR\jellyfin.exe" -SectionEnd - -;TODO -; This section hasn't been tested completely. Section /o "Start Jellyfin after installation" LaunchJellyfin ; either start the service or launch jellyfin standalone StrCmp $_SERVICEINSTALLED_ "YES" ServiceStart Standalone ServiceStart: - ExecWait 'C:\Windows\System32\sc.exe start Jellyfin' $0 + ExecWait '"$INSTDIR\nssm.exe" start Jellyfin' $0 DetailPrint "Jellyfin service start, $0" Return @@ -162,9 +160,14 @@ SectionEnd ;Uninstaller Section Section "Uninstall" + SetShellVarContext current + StrCpy $_JELLYFINDATADIR_ "$LOCALAPPDATA\jellyfin\" ;TODO -; stop service or running instance -; Figure out a way to stop Jellyfin - either standalone or service when uninstaller is invoked +; stop running instance + ExecWait '"$INSTDIR\nssm.exe" stop Jellyfin' $0 + DetailPrint "Jellyfin service stop, $0" + ExecWait '"$INSTDIR\nssm.exe" remove Jellyfin confirm' $0 + DetailPrint "Jellyfin Service remove, $0" Delete "$INSTDIR\Uninstall.exe" RMDir /r "$INSTDIR" @@ -181,7 +184,9 @@ Function .onInit ; Align installer version with jellyfin.dll version !getdllversion "$%InstallLocation%\jellyfin.dll" ver_ StrCpy $_JELLYFINVERSION_ "${ver_1}.${ver_2}.${ver_3}.${ver_4}" - StrCpy $_JELLYFINDATADIR_ "$LOCALAPPDATA\jellyfin\" + SetShellVarContext current + StrCpy $_JELLYFINDATADIR_ "$LOCALAPPDATA\jellyfin\" + DetailPrint "_JELLYFINDATADIR_ : $_JELLYFINDATADIR_" StrCpy $_SERVICEINSTALLED_ "NO" SectionSetFlags ${InstallJellyfin} 17 ; this makes the InstallJellyfin section mandatory FunctionEnd |
