1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-15 07:01:18 +02:00

Innosetup installer updates

Rename usage of outdated Innosetup functions
Configure CMake to use the same build type for Innosetup target
Use Tenacity logos
Update readme information displayed post-install
Update license information displayed pre-install
Fix installer generation
Cleanup innosetup configuration

Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org>
This commit is contained in:
Emily Mabrey
2021-08-26 02:54:16 -04:00
parent a1cfcceaff
commit d73e9eb1cd
7 changed files with 111 additions and 71 deletions

View File

@@ -4,13 +4,16 @@
# SOURCE_DIR - should be set to CMAKE_SOURCE_DIR by teh caller
# OUTPUT_DIR - directory, where installer will be built
# INNO_SETUP_COMPILER - InnoSetup compiler executable
# BUILDING_64_BIT - Flag, that indicates that we are building a 64-bit installer
# IS_64_BIT - Flag, that indicates that we are building a 64-bit installer
# EMBED_MANUAL - embed a fresh copy of manual
# SIGN - sign the installer
# WINDOWS_CERTIFICATE - path to PFX file. If not present, env:WINDOWS_CERTIFICATE will be used
# WINDOWS_CERTIFICATE_PASSWORD - password for the PFX file. If not present, env:WINDOWS_CERTIFICATE_PASSWORD will be used
if( BUILDING_64_BIT )
# Allow if statements to use the new IN_LIST operator (compatibility override for CMake <3.3)
cmake_policy( SET CMP0057 NEW )
if( IS_64_BIT )
set( INSTALLER_SUFFIX "x64" )
set( INSTALLER_X64_MODE "ArchitecturesInstallIn64BitMode=x64")
else()
@@ -48,32 +51,76 @@ configure_file("${OUTPUT_DIR}/tenacity.iss.in" "${OUTPUT_DIR}/tenacity.iss")
file(COPY "${SOURCE_DIR}/presets" DESTINATION "${OUTPUT_DIR}/Additional")
file(COPY
file(COPY
"${SOURCE_DIR}/LICENSE.txt"
"${SOURCE_DIR}/README.md"
"${SOURCE_DIR}/win/README.rtf"
"${SOURCE_DIR}/win/tenacity.ico"
DESTINATION
"${SOURCE_DIR}/win/darktenacity.ico"
DESTINATION
"${OUTPUT_DIR}/Additional"
)
if( DEFINED CMAKE_BUILD_TYPE )
if( EXISTS "${BUILD_DIR}/bin/${CMAKE_BUILD_TYPE}" )
# Use CMAKE_BUILD_TYPE value if defined and previously built
set( INNOSETUP_BUILD_CONFIGURATIONS "${CMAKE_BUILD_TYPE};" )
else()
message( FATAL_ERROR "You defined a value for CMAKE_BUILD_TYPE which has not already been built, please build it and try again" )
endif()
elseif( DEFINED CMAKE_INSTALL_CONFIG_NAME )
if( EXISTS "${BUILD_DIR}/bin/${CMAKE_INSTALL_CONFIG_NAME}" )
# Use install --config value if defined and previously built
set( INNOSETUP_BUILD_CONFIGURATIONS "${CMAKE_INSTALL_CONFIG_NAME};" )
else()
message( FATAL_ERROR "You defined a value for CMAKE_INSTALL_CONFIG_NAME which has not already been built, please build it and try again" )
endif()
else()
# These are listed in order of preference in case more than one of them are built
# It must include all four configurations for this to work correctly on multi-config
set( INNOSETUP_BUILD_CONFIGURATIONS "MinSizeRel;Release;RelWithDebInfo;Debug" )
message( STATUS "You did not define a build type manually so we will attempt to find build types in this order: ${INNOSETUP_BUILD_CONFIGURATIONS}" )
endif()
# "Install" prebuilt package
execute_process(
COMMAND
${CMAKE_COMMAND}
--install ${BUILD_DIR}
--prefix "${OUTPUT_DIR}/Package"
)
set( VALID_BUILD_TYPE_FOUND FALSE )
foreach( config ${INNOSETUP_BUILD_CONFIGURATIONS} )
file( GLOB VALID_BUILD
"${BUILD_DIR}/bin/${config}/Tenacity" "${BUILD_DIR}/bin/${config}/Tenacity.*"
"${BUILD_DIR}/bin/${config}/tenacity" "${BUILD_DIR}/bin/${config}/tenacity.*"
)
if( VALID_BUILD )
message ( STATUS "Using build type ${config} to create innosetup installer" )
execute_process(
COMMAND
${CMAKE_COMMAND}
--install ${BUILD_DIR}
--prefix "${OUTPUT_DIR}/Package"
--config ${config}
# When we upgrade to CMake min version 3.19 we can use this
# COMMAND_ERROR_IS_FATAL ANY
)
set( VALID_BUILD_TYPE_FOUND TRUE FORCE )
set( VALID_BUILD_TYPE ${config} )
break()
endif()
endforeach()
# Build the installer
if( NOT VALID_BUILD_TYPE_FOUND )
message( FATAL_ERROR "You must build the project successfully before building the innosetup target" )
endif()
execute_process(
COMMAND
${INNO_SETUP_COMPILER} /Sbyparam=$p "tenacity.iss"
${INNO_SETUP_COMPILER} /Sbyparam=$p "tenacity.iss" /Qp
WORKING_DIRECTORY
${OUTPUT_DIR}
# When we upgrade to CMake min version 3.19 we can use this
# COMMAND_ERROR_IS_FATAL ANY
)
# Emulate CPack behavior
# If we enable COMMAND_ERROR_IS_FATAL then if we reach here we are sure we successfully created the installer
# message ( STATUS "Successfully created innosetup installer using build type ${VALID_BUILD_TYPE}" )
# Emulate CPack behavior
file( COPY "${OUTPUT_DIR}/Output/" DESTINATION "${BUILD_DIR}/package" )

View File

@@ -3,81 +3,71 @@
; License: GPL v2. See License.txt.
;
; tenacity.iss
; Vaughan Johnson, Leland Lucius, Martyn Shaw, Richard Ash, & others
;
; This requires that the ISS Preprocessor be installed
#define AppExe "Package\tenacity.exe"
#define AppExe "Package\tenacity.exe"
#define AppMajor ""
#define AppMinor ""
#define AppRev ""
#define AppBuild ""
#define FullVersion ParseVersion(AppExe, AppMajor, AppMinor, AppRev, AppBuild)
#define FullVersion GetVersionComponents(AppExe, AppMajor, AppMinor, AppRev, AppBuild)
#define AppVersion Str(AppMajor) + "." + Str(AppMinor) + "." + Str(AppRev)
#define AppName GetStringFileInfo(AppExe, PRODUCT_NAME)
[UninstallRun]
; Uninstall prior installations.
Filename: "{app}\unins*.*";
Filename: "{app}\unins*.*"; RunOnceId: "UninstallPrior"
[Setup]
; compiler-related directives
OutputBaseFilename=tenacity-win-{#AppVersion}-@INSTALLER_SUFFIX@
; Use 100% images by default
; Icons
SetupIconFile="Additional\tenacity.ico"
UninstallDisplayIcon="{app}\tenacity.exe"
WizardImageFile=".\tenacity_InnoWizardImage_100.bmp"
WizardSmallImageFile=".\tenacity_InnoWizardSmallImage_100.bmp"
SolidCompression=yes
; installer-related directives
; From Inno 5.5.7, Inno defaults to disabling the Welcome page as recommended
; by Microsoft's desktop applications guideline, but we don't want to do that.
DisableWelcomePage=no
; App/Version information
AppName={#AppName}
AppVerName=Tenacity {#AppVersion}
; Specify AppVersion as well, so it appears in the Add/Remove Programs entry.
AppVersion={#AppVersion}
AppPublisher="Tenacity Team"
AppPublisherURL=https://tenacityaudio.org/
AppSupportURL=https://tenacityaudio.org/
AppUpdatesURL=https://tenacityaudio.org/
ChangesAssociations=yes
@INSTALLER_X64_MODE@
DefaultDirName={commonpf}\Tenacity
VersionInfoProductName={#AppName}
VersionInfoProductTextVersion={#GetFileProductVersion(AppExe)}
VersionInfoDescription={#AppName + " " + AppVersion + " Setup"}
VersionInfoVersion={#GetFileVersion(AppExe)}
VersionInfoVersion={#GetVersionNumbersString(AppExe)}
VersionInfoCopyright={#GetFileCopyright(AppExe)}
; Don't disable the "Select Destination Location" wizard, even if
; Default install location
DefaultDirName={commonpf}\Tenacity
; Tells explorer to refresh file assocations to pickup any changes
ChangesAssociations=yes
; Does package->compress instead of compress->package
SolidCompression=yes
; Don't disable the "Select Destination Location" wizard, even if
; Tenacity is already installed.
DisableDirPage=no
; Always warn if dir exists, because we'll overwrite previous Tenacity.
DirExistsWarning=yes
DisableProgramGroupPage=yes
UninstallDisplayIcon="{app}\tenacity.exe"
; No longer force them to accept the license, just display it. LicenseFile=..\LICENSE.txt
; Always show welcome page
DisableWelcomePage=no
; Display license information before install
InfoBeforeFile=".\tenacity_InnoWizard_InfoBefore.rtf"
InfoAfterFile=Additional\README.md
; We no longer produce new ANSI builds.
; As we use Inno Setup (u), the Unicode version, to build this script,
; the MinVersion will automatically be set to what we need.
; We no longer explicitly set it.
; MinVersion=4.0,5.0
; cosmetic-related directives
SetupIconFile="Additional\tenacity.ico"
; Display README after install
InfoAfterFile=Additional\README.rtf
; Directives using information passed by CMake
@INSTALLER_X64_MODE@
@SIGN_TOOL@
OutputBaseFilename=tenacity-win-{#AppVersion}-@INSTALLER_SUFFIX@
[INI]
Filename: "{app}\FirstTime.ini"; Section: "FromInno"; Key: "ResetPrefs"; String: "1"; Tasks: resetPrefs;
@@ -93,8 +83,8 @@ Name: resetPrefs; Description: "{cm:ResetPrefs}"; Flags: unchecked
; Prime the first time .ini file so the permissions can be set
Source: ".\FirstTimeModel.ini"; DestDir: "{app}"; DestName: "FirstTime.ini"; Permissions: users-modify
; Don't display in separate window, rather as InfoAfterFile. Source: "..\README.md"; DestDir: "{app}"; Flags: ignoreversion isreadme
Source: "Additional\README.md"; DestDir: "{app}"; Flags: ignoreversion
; Manually create RTF version of README
Source: "Additional\README.rtf"; DestDir: "{app}"; Flags: ignoreversion
Source: "Additional\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppExe}"; DestDir: "{app}"; Flags: ignoreversion
@@ -150,7 +140,7 @@ end;
procedure InitializeWizard;
begin
{ If using larger scaling, load the correct size of images }
if GetScalingFactor > 100 then
if GetScalingFactor > 100 then
begin
LoadEmbededScaledBitmap(WizardForm.WizardBitmapImage, 'tenacity_InnoWizardImage');
LoadEmbededScaledBitmap(WizardForm.WizardBitmapImage2, 'tenacity_InnoWizardImage');
@@ -163,32 +153,31 @@ Name: "{commonprograms}\Tenacity"; Filename: "{app}\tenacity.exe"
Name: "{commondesktop}\Tenacity"; Filename: "{app}\tenacity.exe"; Tasks: desktopicon
[InstallDelete]
; Get rid of Tenacity 1.0.0 stuff that's no longer used.
Type: files; Name: "{app}\tenacity-help.htb"
Type: files; Name: "{app}\tenacity-1.2-help.htb"
; Get rid of previous versions of MSVC runtimes.
; Get rid of previous versions of MSVC runtimes
; Currently MSVC runtime versions 8, 9, 10, 11, 12, 13
Type: files; Name: "{app}\Microsoft.VC80.CRT.manifest"
Type: files; Name: "{app}\Microsoft.VC90.CRT.manifest"
Type: files; Name: "{app}\msvcp80.dll"
Type: files; Name: "{app}\msvcr80.dll"
Type: files; Name: "{app}\Microsoft.VC90.CRT.manifest"
Type: files; Name: "{app}\msvcp90.dll"
Type: files; Name: "{app}\msvcr90.dll"
Type: files; Name: "{app}\Microsoft.VC100.CRT.manifest"
Type: files; Name: "{app}\msvcp100.dll"
Type: files; Name: "{app}\msvcr100.dll"
Type: files; Name: "{app}\Microsoft.VC110.CRT.manifest"
Type: files; Name: "{app}\msvcp110.dll"
Type: files; Name: "{app}\msvcr110.dll"
Type: files; Name: "{app}\Microsoft.VC120.CRT.manifest"
Type: files; Name: "{app}\msvcp120.dll"
Type: files; Name: "{app}\msvcr120.dll"
Type: files; Name: "{app}\Microsoft.VC130.CRT.manifest"
Type: files; Name: "{app}\msvcp130.dll"
Type: files; Name: "{app}\msvcr130.dll"
; Get rid of previous help folder.
Type: filesandordirs; Name: "{app}\help"
; Don't want to do this because user may have stored their own.
; Type: filesandordirs; Name: "{app}\vst"
; We've switched from a folder in the start menu to just the Tenacity.exe at the top level.
; Get rid of 1.0.0 folder and its icons.
Type: files; Name: "{commonprograms}\Tenacity\tenacity.exe"
Type: files; Name: "{commonprograms}\Tenacity\unins000.exe"
Type: dirifempty; Name: "{commonprograms}\Tenacity"
;Get rid of previous uninstall item
Type: files; Name: "{app}\unins*.*"
@@ -217,7 +206,7 @@ Type: files; Name: "{app}\Plug-Ins\gverb_1216.dll"
Type: files; Name: "{app}\Plug-Ins\crossfadein.ny"
Type: files; Name: "{app}\Plug-Ins\crossfadeout.ny"
Type: files; Name: "{app}\Plug-Ins\clicktrack.ny"
[Registry]
; No longer allow user to choose whether to associate AUP file type with Tenacity.
; Leaving this one commented out example of the old way.
@@ -248,7 +237,7 @@ Filename: "{app}\tenacity.exe"; Description: "{cm:LaunchProgram,Tenacity}"; Flag
; http://www.jrsoftware.org/files/istrans/
;
; Set this to the base of the unofficial Inno Setup translations
#define UrlBase "http://raw.github.com/jrsoftware/issrc/master/Files/Languages/Unofficial/"
#define UrlBase "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/"
; This macro will use the Windows PowerShell to download the given translation into
; the Inno Setup Languages folder if it hasn't already been downloaded.