浏览代码

Change the default AppExit action to Exit

When the service should fail to launch Jellyfin, or should Jellyfin crash, the default action is changed from Restart to AppExit. This prevents the service from entering a constant restart due to a permissions issue or similar.
Anthony Lavado 5 年之前
父节点
当前提交
14a850b4a8
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      deployment/windows/jellyfin.nsi

+ 9 - 0
deployment/windows/jellyfin.nsi

@@ -251,6 +251,15 @@ ${If} $_INSTALLSERVICE_ == "Yes" ; Only run this if we're going to install the s
         ${EndIf}
         DetailPrint "Jellyfin Server service account change, $0"
     ${EndIf}
+
+    Sleep 3000
+    ConfigureDefaultAppExit:
+        ExecWait '"$INSTDIR\nssm.exe" set JellyfinServer AppExit Default Exit' $0
+        ${If} $0 <> 0
+            !insertmacro ShowError "Could not configure the Jellyfin Server service app exit action." ConfigureDefaultAppExit
+        ${EndIf}
+        DetailPrint "Jellyfin Server service exit action set, $0"
+    ${EndIf}
 ${EndIf}
 
 SectionEnd