Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Port and Running Check fixes #129

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jellyfin.Windows.Tray/TrayApplicationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private void LoadJellyfinConfig()
XPathNavigator networkReader = networkXml.CreateNavigator();

_networkAddress = networkReader.SelectSingleNode("/NetworkConfiguration/LocalNetworkAddresses").Value;
_port = networkReader.SelectSingleNode("/NetworkConfiguration/HttpServerPortNumber")?.Value;
_port = networkReader.SelectSingleNode("/NetworkConfiguration/InternalHTTPPort")?.Value;
_baseUrl = networkReader.SelectSingleNode("/NetworkConfiguration/BaseUrl")?.Value;
}

Expand Down
19 changes: 9 additions & 10 deletions nsis/jellyfin.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,6 @@ Function .onInit
StrCmp $R0 0 +3
!insertmacro ShowErrorFinal "The installer is already running."


; This stops the installer from starting if jellyfin.exe is open
StrCpy $1 "jellyfin.exe"
nsProcess::_FindProcess "$1"
Pop $R1
${If} $R1 = 0
!insertmacro ShowErrorFinal "Jellyfin is running. Please close it first."
Abort
${EndIf}

;Detect if Jellyfin is already installed.
; In case it is installed, let the user choose either
; 1. Exit installer
Expand Down Expand Up @@ -434,6 +424,15 @@ Function .onInit
SectionSetText ${CreateWinShortcuts} ""

NoService: ; existing install was present but no service was detected
; This stops the installer from starting if jellyfin.exe is open
StrCpy $1 "jellyfin.exe"
nsProcess::_FindProcess "$1"
Pop $R1
${If} $R1 = 0
!insertmacro ShowErrorFinal "Jellyfin is running. Please close it first."
Abort
${EndIf}

${If} $_SERVICEACCOUNTTYPE_ == "None"
StrCpy $_SETUPTYPE_ "Basic"
StrCpy $_INSTALLSERVICE_ "No"
Expand Down