@ -4,12 +4,11 @@
#define AppName "Lidarr"
#define AppName "Lidarr"
#define AppPublisher "Team Lidarr"
#define AppPublisher "Team Lidarr"
#define AppURL "https://lidarr.audio/"
#define AppURL "https://lidarr.audio/"
#define ForumsURL "https://forums. lidarr.audio/"
#define ForumsURL "https://lidarr.audio/discord "
#define AppExeName "Lidarr.exe"
#define AppExeName "Lidarr.exe"
#define BaseVersion GetEnv('MAJORVERSION')
#define BaseVersion GetEnv('MAJORVERSION')
#define BuildNumber GetEnv('MINORVERSION')
#define BuildNumber GetEnv('MINORVERSION')
#define BuildVersion GetEnv('LIDARRVERSION')
#define BuildVersion GetEnv('LIDARRVERSION')
#define BranchName GetEnv('BUILD_SOURCEBRANCHNAME')
[Setup]
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; NOTE: The value of AppId uniquely identifies this application.
@ -22,15 +21,15 @@ AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppPublisherURL={#AppURL}
AppSupportURL={#ForumsURL}
AppSupportURL={#ForumsURL}
AppUpdatesURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={commonappdata}\Lidarr\bin
DefaultDirName={commonappdata}\Lidarr
DisableDirPage=yes
DisableDirPage=yes
DefaultGroupName={#AppName}
DefaultGroupName={#AppName}
DisableProgramGroupPage=yes
DisableProgramGroupPage=yes
OutputBaseFilename=Lidarr.{#BranchName}.{#BuildVersion}.windows.{#Framework }
OutputBaseFilename=Lidarr.{#BuildVersion}.{#Runtime }
SolidCompression=yes
SolidCompression=yes
AppCopyright=Creative Commons 3.0 License
AppCopyright=Creative Commons 3.0 License
AllowUNCPath=False
AllowUNCPath=False
UninstallDisplayIcon={app}\Lidarr.exe
UninstallDisplayIcon={app}\bin\ Lidarr.exe
DisableReadyPage=True
DisableReadyPage=True
CompressionThreads=2
CompressionThreads=2
Compression=lzma2/normal
Compression=lzma2/normal
@ -38,6 +37,7 @@ AppContact={#ForumsURL}
VersionInfoVersion={#BaseVersion}.{#BuildNumber}
VersionInfoVersion={#BaseVersion}.{#BuildNumber}
SetupLogging=yes
SetupLogging=yes
OutputDir=output
OutputDir=output
WizardStyle=modern
[Languages]
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "english"; MessagesFile: "compiler:Default.isl"
@ -48,33 +48,37 @@ Name: "windowsService"; Description: "Install Windows Service (Starts when the c
Name: "startupShortcut"; Description: "Create shortcut in Startup folder (Starts when you log into Windows)"; GroupDescription: "Start automatically"; Flags: exclusive
Name: "startupShortcut"; Description: "Create shortcut in Startup folder (Starts when you log into Windows)"; GroupDescription: "Start automatically"; Flags: exclusive
Name: "none"; Description: "Do not start automatically"; GroupDescription: "Start automatically"; Flags: exclusive unchecked
Name: "none"; Description: "Do not start automatically"; GroupDescription: "Start automatically"; Flags: exclusive unchecked
[Dirs]
Name: "{app}"; Permissions: users-modify
[Files]
[Files]
Source: "..\_artifacts\{#Runtime}\{#Framework}\Lidarr\Lidarr.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_artifacts\{#Runtime}\{#Framework}\Lidarr\Lidarr.exe"; DestDir: "{app}\bin "; Flags: ignoreversion
Source: "..\_artifacts\{#Runtime}\{#Framework}\Lidarr\*"; Excludes: "Lidarr.Update"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\_artifacts\{#Runtime}\{#Framework}\Lidarr\*"; Excludes: "Lidarr.Update"; DestDir: "{app}\bin "; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Parameters: "/icon"
Name: "{group}\{#AppName}"; Filename: "{app}\bin\ {#AppExeName}"; Parameters: "/icon"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Parameters: "/icon"; Tasks: desktopIcon
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\bin\ {#AppExeName}"; Parameters: "/icon"; Tasks: desktopIcon
Name: "{userstartup}\{#AppName}"; Filename: "{app}\Lidarr.exe"; WorkingDir: "{app}"; Tasks: startupShortcut
Name: "{userstartup}\{#AppName}"; Filename: "{app}\bin\ Lidarr.exe"; WorkingDir: "{app}\bin "; Tasks: startupShortcut
[InstallDelete]
[InstallDelete]
Name: "{app}"; Type: filesandordirs
Name: "{app}\bin "; Type: filesandordirs
[Run]
[Run]
Filename: "{app}\Lidarr.Console.exe"; StatusMsg: "Removing previous Windows Service"; Parameters: "/u /exitimmediately"; Flags: runhidden waituntilterminated;
Filename: "{app}\bin\ Lidarr.Console.exe"; StatusMsg: "Removing previous Windows Service"; Parameters: "/u /exitimmediately"; Flags: runhidden waituntilterminated;
Filename: "{app}\Lidarr.Console.exe"; Description: "Enable Access from Other Devices"; StatusMsg: "Enabling Remote access"; Parameters: "/registerurl /exitimmediately"; Flags: postinstall runascurrentuser runhidden waituntilterminated; Tasks: startupShortcut none;
Filename: "{app}\bin\ Lidarr.Console.exe"; Description: "Enable Access from Other Devices"; StatusMsg: "Enabling Remote access"; Parameters: "/registerurl /exitimmediately"; Flags: postinstall runascurrentuser runhidden waituntilterminated; Tasks: startupShortcut none;
Filename: "{app}\Lidarr.Console.exe"; StatusMsg: "Installing Windows Service"; Parameters: "/i /exitimmediately"; Flags: runhidden waituntilterminated; Tasks: windowsService
Filename: "{app}\bin\ Lidarr.Console.exe"; StatusMsg: "Installing Windows Service"; Parameters: "/i /exitimmediately"; Flags: runhidden waituntilterminated; Tasks: windowsService
Filename: "{app}\Lidarr.exe"; Description: "Open Lidarr Web UI"; Flags: postinstall skipifsilent nowait; Tasks: windowsService;
Filename: "{app}\bin\ Lidarr.exe"; Description: "Open Lidarr Web UI"; Flags: postinstall skipifsilent nowait; Tasks: windowsService;
Filename: "{app}\Lidarr.exe"; Description: "Start Lidarr"; Flags: postinstall skipifsilent nowait; Tasks: startupShortcut none;
Filename: "{app}\bin\ Lidarr.exe"; Description: "Start Lidarr"; Flags: postinstall skipifsilent nowait; Tasks: startupShortcut none;
[UninstallRun]
[UninstallRun]
Filename: "{app}\lidarr.console.exe"; Parameters: "/u"; Flags: waituntilterminated skipifdoesntexist
Filename: "{app}\bin\ lidarr.console.exe"; Parameters: "/u"; Flags: waituntilterminated skipifdoesntexist
[Code]
[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
var
ResultCode: Integer;
ResultCode: Integer;
begin
begin
Exec(ExpandConstant('{commonappdata}\Lidarr\bin\Lidarr.Console.exe'), '/u', '', 0, ewWaitUntilTerminated, ResultCode)
Exec('net', 'stop lidarr', '', 0, ewWaitUntilTerminated, ResultCode)
Exec('sc', 'delete lidarr', '', 0, ewWaitUntilTerminated, ResultCode)
end;
end;