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:
parent
1229815299
commit
16489c4180
|
@ -270,16 +270,17 @@ configure_file(
|
|||
"${PROJECT_BINARY_DIR}/generated/module.cpp"
|
||||
)
|
||||
|
||||
# Packaging
|
||||
if("${CMAKE_PACKAGE_SUFFIX_OVERRIDE}" STREQUAL "")
|
||||
if(NOT TARGET libobs)
|
||||
# Packaging
|
||||
if("${CMAKE_PACKAGE_SUFFIX_OVERRIDE}" STREQUAL "")
|
||||
set(_PACKAGE_SUFFIX_OVERRIDE "${VERSION_STRING}")
|
||||
else()
|
||||
else()
|
||||
set(_PACKAGE_SUFFIX_OVERRIDE "${CMAKE_PACKAGE_SUFFIX_OVERRIDE}")
|
||||
endif()
|
||||
set(_PACKAGE_FULL_NAME "${CMAKE_PACKAGE_PREFIX}/${CMAKE_PACKAGE_NAME}-${_PACKAGE_SUFFIX_OVERRIDE}")
|
||||
endif()
|
||||
set(_PACKAGE_FULL_NAME "${CMAKE_PACKAGE_PREFIX}/${CMAKE_PACKAGE_NAME}-${_PACKAGE_SUFFIX_OVERRIDE}")
|
||||
|
||||
# Windows
|
||||
if(WIN32)
|
||||
# Windows
|
||||
if(WIN32)
|
||||
## Installer (InnoSetup)
|
||||
get_filename_component(ISS_FILES_DIR "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
|
||||
file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR)
|
||||
|
@ -287,6 +288,8 @@ if(WIN32)
|
|||
file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR)
|
||||
get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE)
|
||||
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(
|
||||
"cmake/installer.iss.in"
|
||||
"${PROJECT_BINARY_DIR}/installer.iss"
|
||||
|
@ -304,10 +307,11 @@ if(WIN32)
|
|||
"${PROJECT_BINARY_DIR}/generated/version.rc"
|
||||
@ONLY
|
||||
)
|
||||
endif()
|
||||
|
||||
# Download OBS Studio and OBS Dependencies
|
||||
if(${PropertyPrefix}OBS_DOWNLOAD)
|
||||
endif()
|
||||
|
||||
# Download OBS Studio and OBS Dependencies
|
||||
if(${PropertyPrefix}OBS_DOWNLOAD)
|
||||
include("DownloadProject")
|
||||
|
||||
set(OBS_DOWNLOAD_VERSION "25.0.3-fe-ci")
|
||||
|
@ -341,19 +345,19 @@ if(${PropertyPrefix}OBS_DOWNLOAD)
|
|||
# Other OS
|
||||
message(FATAL "Unable to download libOBS as this Operating System is not yet supported.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Load OBS Studio & Dependencies
|
||||
if(${PropertyPrefix}OBS_PACKAGE)
|
||||
# Load OBS Studio & Dependencies
|
||||
if(${PropertyPrefix}OBS_PACKAGE)
|
||||
include("${OBS_STUDIO_DIR}/cmake/LibObs/LibObsConfig.cmake")
|
||||
if (EXISTS "${OBS_STUDIO_DIR}/cmake/obs-frontend-api/obs-frontend-apiConfig.cmake")
|
||||
include("${OBS_STUDIO_DIR}/cmake/obs-frontend-api/obs-frontend-apiConfig.cmake")
|
||||
set(HAVE_OBS_FRONTEND TRUE)
|
||||
endif()
|
||||
elseif(${PropertyPrefix}OBS_REFERENCE)
|
||||
elseif(${PropertyPrefix}OBS_REFERENCE)
|
||||
set(obsPath "${OBS_STUDIO_DIR}")
|
||||
include("${OBS_STUDIO_DIR}/cmake/external/FindLibobs.cmake")
|
||||
elseif(${PropertyPrefix}OBS_DOWNLOAD)
|
||||
elseif(${PropertyPrefix}OBS_DOWNLOAD)
|
||||
set(_INCLUDE_PREFIX "")
|
||||
if(WIN32)
|
||||
set(_INCLUDE_PREFIX "${libobs_SOURCE_DIR}/cmake")
|
||||
|
@ -382,6 +386,7 @@ elseif(${PropertyPrefix}OBS_DOWNLOAD)
|
|||
endif()
|
||||
set(HAVE_OBS_FRONTEND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# QT5
|
||||
|
|
|
@ -10,31 +10,41 @@
|
|||
; NOTE: The value of AppId uniquely identifies this application.
|
||||
; Do not use the same AppId value in installers for other applications.
|
||||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||
|
||||
; app Information
|
||||
AppId={{DE56A03A-C8A4-474B-83B0-CFD270262D38}}
|
||||
AppName={#MyAppName}
|
||||
AppVersion={#MyAppVersion}
|
||||
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||
AppPublisher={#MyAppPublisher}
|
||||
AppPublisherURL={#MyAppURL}
|
||||
AppSupportURL={#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}
|
||||
DefaultGroupName={#MyAppName}
|
||||
AllowNoIcons=yes
|
||||
LicenseFile="@ISS_SOURCE_DIR@/LICENSE"
|
||||
OutputDir="@ISS_PACKAGE_DIR@"
|
||||
OutputBaseFilename=@CMAKE_PACKAGE_NAME@-@_PACKAGE_SUFFIX_OVERRIDE@
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
VersionInfoVersion={#MyAppVersion}
|
||||
VersionInfoCompany={#MyAppPublisher}
|
||||
VersionInfoDescription={#MyAppName} Setup
|
||||
; Wizard Information
|
||||
WizardStyle=modern
|
||||
WizardResizable=yes
|
||||
SetupIconFile="@PROJECT_SOURCE_DIR@/media/icon.ico"
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
|
||||
[Files]
|
||||
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
|
||||
|
||||
[Icons]
|
||||
|
@ -93,7 +103,7 @@ begin
|
|||
sUnInstallString := GetUninstallString();
|
||||
if sUnInstallString <> '' then begin
|
||||
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
|
||||
else
|
||||
Result := 2;
|
||||
|
@ -103,6 +113,8 @@ end;
|
|||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
procedure CurStepChanged(CurStep: TSetupStep);
|
||||
var
|
||||
ResultCode: Integer;
|
||||
begin
|
||||
if (CurStep=ssInstall) then
|
||||
begin
|
||||
|
@ -111,4 +123,9 @@ begin
|
|||
UnInstallOldVersion();
|
||||
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;
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
Binary file not shown.
Loading…
Reference in New Issue