* Much better, but still broken
It crashes with two custom pages after one another. (So when the service should be installed).
* Fixed the problems and finished the NSIS installer.
Also ignored some of the artifacts.
* Added changes to CI for setup building.
Consolidate building and fixed git error.
Small CI fixes.
Move UX repo to SourcesDirectory
Fix stupid checkout <> clone error.
Fix typo in PowerShell command.
Artifact publish tasks can not have wildcards.
pull/1731/head
Erwin de Haan6 years agocommitted byAnthony Lavado
This file was created by NSISDialogDesigner 1.4.4.0
http://coolsoft.altervista.org/nsisdialogdesigner
Do not edit manually!
-->
<Dialog Name="confirmation" Title="Confirmation Page" Subtitle="Please confirm your choices for Jellyfin Server installation" GenerateShowFunction="False">
This file was created by NSISDialogDesigner 1.4.4.0
http://coolsoft.altervista.org/nsisdialogdesigner
Do not edit manually!
-->
<Dialog Name="service_config" Title="CoOnfigure the service" Subtitle="This controls what type of access the server gets to this system." GenerateShowFunction="False">
<CheckBox Name="StartServiceAfterInstall" Location="12, 192" Size="426, 24" Text="Start Service after Install" Checked="True" TabIndex="0" />
<Label Name="LocalSystemAccountLabel" Location="12, 115" Size="426, 46" Text="The Local System account has full access to every resource and file on the system. This can have very real security implications, do not use unless absolutely neseccary." TabIndex="1" />
<Label Name="NetworkServiceAccountLabel" Location="12, 39" Size="426, 46" Text="The NetworkService account is a predefined local account used by the service control manager. It is the recommended way to install the Jellyfin Server service." TabIndex="2" />
<RadioButton Name="UseLocalSystemAccount" Location="12, 88" Size="426, 24" Text="Use Local System account" TabIndex="3" />
<RadioButton Name="UseNetworkServiceAccount" Location="12, 12" Size="426, 24" Text="Use Network Service account (Recommended)" Font="Microsoft Sans Serif, 8.25pt, style=Bold" Checked="True" TabIndex="4" />
${NSD_CreateLabel} 8u 71u 280u 28u "The Local System account has full access to every resource and file on the system. This can have very real security implications, do not use unless absolutely neseccary."
${NSD_CreateLabel} 8u 24u 280u 28u "The NetworkService account is a predefined local account used by the service control manager. It is the recommended way to install the Jellyfin Server service."
Pop $hCtl_service_config_NetworkServiceAccountLabel
!define MUI_WELCOMEPAGE_TEXT "The installer will ask for details to install Jellyfin Server.$\r$\n$\r$\n$\r$\n\
ADVANCED:$\r$\n\
The default service install uses Network Service account and is sufficient for most users. $\r$\n$\r$\n\
You can choose to install using Local System account under Advanced options. This also affects where Jellyfin Server and Jellyfin data can be installed. The installer will NOT check this, you should know what you are doing.$\r$\n$\r$\n\
You can choose the folder for Jellyfin Metadata under advanced options based on your needs."
!define MUI_WELCOMEPAGE_TEXT "The installer will ask for details to install Jellyfin Server."
!insertmacro MUI_PAGE_WELCOME
; License Page
!insertmacro MUI_PAGE_LICENSE "$%InstallLocation%\LICENSE" ; picking up generic GPL
; Components Page
!define MUI_COMPONENTSPAGE_SMALLDESC
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE HideInstallDirectoryPage ; Controls when to hide / show
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Install folder" ; shows just above the folder selection dialog
!insertmacro MUI_PAGE_DIRECTORY
; Metadata folder Page
; Data folder Page
!define MUI_PAGE_CUSTOMFUNCTION_PRE HideDataDirectoryPage ; Controls when to hide / show
!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install the Jellyfin Server metadata."
!define MUI_DIRECTORYPAGE_TEXT_TOP "The installer will set the following folder for Jellyfin Server metadata. To install in a differenct folder, click Browse and select another folder. Please make sure the folder exists. Click Next to continue."
!define MUI_PAGE_HEADER_TEXT "Choose Data Location"
!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install the Jellyfin Server data."
!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."
ReadRegStr $INSTDIR HKLM "Software\Jellyfin" "InstallFolder" ; read the installation folder
ReadRegStr $_JELLYFINDATADIR_ HKLM "Software\Jellyfin" "DataFolder" ; read the metadata folder
ReadRegStr $INSTDIR HKLM "${REG_CONFIG_KEY}" "InstallFolder" ; read the installation folder
ReadRegStr $_JELLYFINDATADIR_ HKLM "${REG_CONFIG_KEY}" "DataFolder" ; read the data folder
DetailPrint "Jellyfin Install location: $INSTDIR"
DetailPrint "Jellyfin data folder : $_JELLYFINDATADIR_"
DetailPrint "Jellyfin Data folder: $_JELLYFINDATADIR_"
MessageBox MB_YESNO|MB_ICONINFORMATION "Do you want to retain Jellyfin metadata folder? The media will not be touched. $\r$\nIf unsure choose YES." /SD IDYES IDYES PreserveData
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
RMDir /r /REBOOTOK "$_JELLYFINDATADIR_"
PreserveData:
DetailPrint "Attempting to stop Jellyfin Server"
ExecWait '"$INSTDIR\nssm.exe" stop Jellyfin' $0
DetailPrint "Jellyfin service stop, $0"
DetailPrint "Attempting to remove Jellyfin service"
DetailPrint "Jellyfin Server service statuscode, $0"
IntCmp $0 0 NoService ; service doesn't exist, may be run from desktop shortcut
; if service was detected, set defaults going forward.
StrCpy $_EXISTINGSERVICE_ "YES"
StrCpy $_INSTALLSERVICE_ "YES"
StrCpy $_SERVICESTART_ "YES"
StrCpy $_EXISTINGSERVICE_ "Yes"
StrCpy $_INSTALLSERVICE_ "Yes"
StrCpy $_SERVICESTART_ "Yes"
; check if service was run using Network Service account
ClearErrors
ReadRegStr "$_LOCALSYSTEMACCOUNT_" HKLM "Software\Jellyfin" "LocalSystemAccount" ; in case of error _LOCALSYSTEMACCOUNT_ will be NO as default
ReadRegStr $_SERVICEACCOUNTTYPE_ HKLM "${REG_CONFIG_KEY}" "ServiceAccountType" ; in case of error _SERVICEACCOUNTTYPE_ will be NetworkService as default
ClearErrors
ReadRegStr $_JELLYFINDATADIR_ HKLM "Software\Jellyfin" "DataFolder" ; in case of error, the default holds
ReadRegStr $_JELLYFINDATADIR_ HKLM "${REG_CONFIG_KEY}" "DataFolder" ; in case of error, the default holds
; Hide sections which will not be needed in case of previous install
SectionSetText ${InstallService} ""
SectionSetText ${StartService} ""
SectionSetText ${LocalSystemAccount} ""
SectionSetText ${CustomDataFolder} ""
SectionSetText ${Advanced} ""
; SectionSetText ${InstallService} ""
NoService: ; existing install was present but no service was detected
; Let the user know that we'll upgrade and provide an option to quit.
MessageBox MB_OKCANCEL|MB_ICONINFORMATION "Existing installation of Jellyfin was detected, it'll be upgraded, settings will be retained. \
MessageBox MB_OKCANCEL|MB_ICONINFORMATION "Existing installation of Jellyfin Server was detected, it'll be upgraded, settings will be retained. \
$\r$\nClick OK to proceed, Cancel to exit installer." /SD IDOK IDOK ProceedWithUpgrade
Quit ; Quit if the user is not sure about upgrade
@ -308,79 +389,83 @@ Function .onInit
FunctionEnd
Function HideInstallDirectoryPage
${If} $_EXISTINGINSTALLATION_ == "YES" ; Existing installation detected, so don't ask for InstallFolder
${If} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder
Abort
${EndIf}
FunctionEnd
; Don't show custom folder option in case it wasn't chosen
Function HideDataDirectoryPage
${If} $_CUSTOMDATAFOLDER_ == "NO"
${If} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder
Abort
${EndIf}
FunctionEnd
; This function handles the choices during component selection
Function .onSelChange
SectionGetFlags ${CustomDataFolder} $0
${If} $0 = ${SF_SELECTED}
StrCpy $_CUSTOMDATAFOLDER_ "YES"
${Else}
StrCpy $_CUSTOMDATAFOLDER_ "NO"
Function HideServiceConfigPage
${If} $_INSTALLSERVICE_ == "No" ; Not running as a service, don't ask for service type
${OrIf} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder
Abort
${EndIf}
FunctionEnd
; If we are not installing service, we don't need to set the NetworkService account or StartService
SectionGetFlags ${InstallService} $0
${If} $0 = ${SF_SELECTED}
StrCpy $_INSTALLSERVICE_ "YES"
SectionGetFlags ${LocalSystemAccount} $0
IntOp $0 $0 | ${SF_RO}
IntOp $0 $0 ^ ${SF_RO}
SectionSetFlags ${LocalSystemAccount} $0
SectionGetFlags ${StartService} $0
IntOp $0 $0 | ${SF_RO}
IntOp $0 $0 ^ ${SF_RO}
SectionSetFlags ${StartService} $0
${Else}
StrCpy $_INSTALLSERVICE_ "NO"
IntOp $0 ${SF_USELECTED} | ${SF_RO}
SectionSetFlags ${LocalSystemAccount} $0
SectionSetFlags ${StartService} $0
Function HideConfirmationPage
${If} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder
Abort
${EndIf}
FunctionEnd
SectionGetFlags ${StartService} $0
${If} $0 = ${SF_SELECTED}
StrCpy $_SERVICESTART_ "YES"
; Service Config dialog show function
Function ShowServiceConfigPage
Call HideServiceConfigPage
Call fnc_service_config_Create
nsDialogs::Show
FunctionEnd
; Confirmation dialog show function
Function ShowConfirmationPage
Call HideConfirmationPage
Call fnc_confirmation_Create
nsDialogs::Show
FunctionEnd
; Declare temp variables to read the options from the custom page.