fixed installer custom library path

This commit is contained in:
Phallacy 2018-12-29 08:08:35 -08:00
parent b4be09898c
commit e222c2deb1

View File

@ -156,9 +156,9 @@ function InstallJellyfin {
Write-Host "Custom Install Location Chosen: $($InstallLocationBox.Text)" Write-Host "Custom Install Location Chosen: $($InstallLocationBox.Text)"
$Script:DefaultJellyfinInstallDirectory = $InstallLocationBox.Text $Script:DefaultJellyfinInstallDirectory = $InstallLocationBox.Text
} }
if($Script:JellyfinDataDir -ne $LibraryLocationBox.Text){ if($Script:JellyfinDataDir -ne $CustomLibraryBox.Text){
Write-Host "Custom Library Location Chosen: $($LibraryLocationBox.Text)" Write-Host "Custom Library Location Chosen: $($CustomLibraryBox.Text)"
$Script:JellyfinDataDir = $LibraryLocationBox.Text $Script:JellyfinDataDir = $CustomLibraryBox.Text
} }
if(-not (Test-Path $Script:DefaultJellyfinInstallDirectory)){ if(-not (Test-Path $Script:DefaultJellyfinInstallDirectory)){
mkdir $Script:DefaultJellyfinInstallDirectory mkdir $Script:DefaultJellyfinInstallDirectory
@ -172,13 +172,13 @@ function InstallJellyfin {
if($Script:InstallServiceAsUser){ if($Script:InstallServiceAsUser){
Write-Host "Installing Service as user $($Script:UserCredentials.UserName)" Write-Host "Installing Service as user $($Script:UserCredentials.UserName)"
&"$Script:DefaultJellyfinInstallDirectory\nssm.exe" install Jellyfin `"$Script:DefaultJellyfinInstallDirectory\jellyfin.exe`" -programdata `"$Script:JellyfinDataDir`" &"$Script:DefaultJellyfinInstallDirectory\nssm.exe" install Jellyfin `"$Script:DefaultJellyfinInstallDirectory\jellyfin.exe`" -programdata `"$Script:JellyfinDataDir`"
Start-Sleep -Milliseconds 500 Start-Sleep -Milliseconds 2000
&sc.exe config Jellyfin obj=".\$($Script:UserCredentials.UserName)" password="$($Script:UserCredentials.GetNetworkCredential().Password)" &sc.exe config Jellyfin obj=".\$($Script:UserCredentials.UserName)" password="$($Script:UserCredentials.GetNetworkCredential().Password)"
&"$Script:DefaultJellyfinInstallDirectory\nssm.exe" set Jellyfin Start SERVICE_DELAYED_AUTO_START &"$Script:DefaultJellyfinInstallDirectory\nssm.exe" set Jellyfin Start SERVICE_DELAYED_AUTO_START
}else{ }else{
Write-Host "Installing Service as LocalSystem" Write-Host "Installing Service as LocalSystem"
&"$Script:DefaultJellyfinInstallDirectory\nssm.exe" install Jellyfin `"$Script:DefaultJellyfinInstallDirectory\jellyfin.exe`" -programdata `"$Script:JellyfinDataDir`" &"$Script:DefaultJellyfinInstallDirectory\nssm.exe" install Jellyfin `"$Script:DefaultJellyfinInstallDirectory\jellyfin.exe`" -programdata `"$Script:JellyfinDataDir`"
Start-Sleep -Milliseconds 500 Start-Sleep -Milliseconds 2000
&"$Script:DefaultJellyfinInstallDirectory\nssm.exe" set Jellyfin Start SERVICE_DELAYED_AUTO_START &"$Script:DefaultJellyfinInstallDirectory\nssm.exe" set Jellyfin Start SERVICE_DELAYED_AUTO_START
} }
} }