project: Improve user experience in the Installer

Adds a BeforeInstall step to the InnoSetup installer which uses the msvc-redist-helper tool to automatically check for the necessary DLLs and install the required redistributable if some are found to be missing.

Additionally slightly modernized the installer with a design that isn't from the 90s, and paves the way for preventing updating StreamFX while OBS Studio is still running.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-07-15 18:07:09 +02:00
parent 1229815299
commit 16489c4180
4 changed files with 129 additions and 107 deletions

View File

@ -270,6 +270,7 @@ configure_file(
"${PROJECT_BINARY_DIR}/generated/module.cpp" "${PROJECT_BINARY_DIR}/generated/module.cpp"
) )
if(NOT TARGET libobs)
# Packaging # Packaging
if("${CMAKE_PACKAGE_SUFFIX_OVERRIDE}" STREQUAL "") if("${CMAKE_PACKAGE_SUFFIX_OVERRIDE}" STREQUAL "")
set(_PACKAGE_SUFFIX_OVERRIDE "${VERSION_STRING}") set(_PACKAGE_SUFFIX_OVERRIDE "${VERSION_STRING}")
@ -287,6 +288,8 @@ if(WIN32)
file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR) file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR)
get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR) file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR)
get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH)
configure_file( configure_file(
"cmake/installer.iss.in" "cmake/installer.iss.in"
"${PROJECT_BINARY_DIR}/installer.iss" "${PROJECT_BINARY_DIR}/installer.iss"
@ -304,6 +307,7 @@ if(WIN32)
"${PROJECT_BINARY_DIR}/generated/version.rc" "${PROJECT_BINARY_DIR}/generated/version.rc"
@ONLY @ONLY
) )
endif() endif()
# Download OBS Studio and OBS Dependencies # Download OBS Studio and OBS Dependencies
@ -383,6 +387,7 @@ elseif(${PropertyPrefix}OBS_DOWNLOAD)
set(HAVE_OBS_FRONTEND TRUE) set(HAVE_OBS_FRONTEND TRUE)
endif() endif()
endif() endif()
endif()
# QT5 # QT5
if(HAVE_OBS_FRONTEND) if(HAVE_OBS_FRONTEND)

View File

@ -10,31 +10,41 @@
; NOTE: The value of AppId uniquely identifies this application. ; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications. ; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
; app Information
AppId={{DE56A03A-C8A4-474B-83B0-CFD270262D38}} AppId={{DE56A03A-C8A4-474B-83B0-CFD270262D38}}
AppName={#MyAppName} AppName={#MyAppName}
AppVersion={#MyAppVersion} AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher} AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL} AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL} AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL} AppUpdatesURL={#MyAppURL}
AppMutex={#MyAppName}
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoDescription={#MyAppName} Setup
; Compression
Compression=lzma2/ultra64
SolidCompression=yes
LZMAAlgorithm=1
; Other Information
DefaultDirName={code:GetDirName} DefaultDirName={code:GetDirName}
DefaultGroupName={#MyAppName} DefaultGroupName={#MyAppName}
AllowNoIcons=yes AllowNoIcons=yes
LicenseFile="@ISS_SOURCE_DIR@/LICENSE" LicenseFile="@ISS_SOURCE_DIR@/LICENSE"
OutputDir="@ISS_PACKAGE_DIR@" OutputDir="@ISS_PACKAGE_DIR@"
OutputBaseFilename=@CMAKE_PACKAGE_NAME@-@_PACKAGE_SUFFIX_OVERRIDE@ OutputBaseFilename=@CMAKE_PACKAGE_NAME@-@_PACKAGE_SUFFIX_OVERRIDE@
Compression=lzma ; Wizard Information
SolidCompression=yes WizardStyle=modern
VersionInfoVersion={#MyAppVersion} WizardResizable=yes
VersionInfoCompany={#MyAppPublisher} SetupIconFile="@PROJECT_SOURCE_DIR@/media/icon.ico"
VersionInfoDescription={#MyAppName} Setup
[Languages] [Languages]
Name: "english"; MessagesFile: "compiler:Default.isl" Name: "english"; MessagesFile: "compiler:Default.isl"
[Files] [Files]
Source: "@ISS_FILES_DIR@/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "@ISS_FILES_DIR@/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "@PROJECT_SOURCE_DIR@/third-party/msvc-redist-helper.exe"; DestDir: "{app}"; DestName: "msvc-redist-helper.exe"; Flags: ignoreversion dontcopy noencryption
; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons] [Icons]
@ -93,7 +103,7 @@ begin
sUnInstallString := GetUninstallString(); sUnInstallString := GetUninstallString();
if sUnInstallString <> '' then begin if sUnInstallString <> '' then begin
sUnInstallString := RemoveQuotes(sUnInstallString); sUnInstallString := RemoveQuotes(sUnInstallString);
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then if Exec(sUnInstallString, '/VERYSILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
Result := 3 Result := 3
else else
Result := 2; Result := 2;
@ -103,6 +113,8 @@ end;
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
procedure CurStepChanged(CurStep: TSetupStep); procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
begin begin
if (CurStep=ssInstall) then if (CurStep=ssInstall) then
begin begin
@ -111,4 +123,9 @@ begin
UnInstallOldVersion(); UnInstallOldVersion();
end; end;
end; end;
if (CurStep=ssPostInstall) then
begin
ExtractTemporaryFile('msvc-redist-helper.exe');
Exec(ExpandConstant('{tmp}\msvc-redist-helper.exe'), '2019', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
end; end;

BIN
media/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
third-party/msvc-redist-helper.exe vendored Normal file

Binary file not shown.