1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 07:42:37 +00:00

Don't include MSVC redist MSM in Windows MSI package (#4339)

* Create Windows MSI package as part of GHA sanity build

* Don't include MSVC redist MSM in Windows MSI package

This approach is deprecated, and was probably never entirely correct to
begin with.
This commit is contained in:
Mike Gelfand 2022-12-09 04:30:43 -08:00 committed by GitHub
parent 0a69685a4e
commit a937dfc897
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 20 deletions

View file

@ -14,6 +14,7 @@ jobs:
outputs:
make-cli: ${{ steps.check-main-push.outputs.is-main-push == '1' || steps.check-diffs.outputs.cli-changed == '1' }}
make-daemon: ${{ steps.check-main-push.outputs.is-main-push == '1' || steps.check-diffs.outputs.daemon-changed == '1' }}
make-dist: ${{ steps.check-main-push.outputs.is-main-push == '1' || steps.check-diffs.outputs.dist-changed == '1' }}
make-docs: ${{ steps.check-main-push.outputs.is-main-push == '1' || steps.check-diffs.outputs.docs-changed == '1' }}
make-gtk: ${{ steps.check-main-push.outputs.is-main-push == '1' || steps.check-diffs.outputs.gtk-changed == '1' }}
make-mac: ${{ steps.check-main-push.outputs.is-main-push == '1' || steps.check-diffs.outputs.mac-changed == '1' }}
@ -56,6 +57,7 @@ jobs:
get_changes any-code CMakeLists.txt Transmission.xcodeproj libtransmission cli daemon gtk macosx qt utils tests web third-party
get_changes our-code CMakeLists.txt Transmission.xcodeproj libtransmission cli daemon gtk macosx qt utils tests web
get_changes daemon CMakeLists.txt Transmission.xcodeproj third-party libtransmission daemon
get_changes dist dist
get_changes docs docs
get_changes gtk CMakeLists.txt third-party libtransmission gtk
get_changes mac CMakeLists.txt Transmission.xcodeproj third-party libtransmission macosx Transmission.xcodeproj
@ -300,7 +302,7 @@ jobs:
windows:
needs: [ what-to-make ]
runs-on: windows-2022
if: ${{ needs.what-to-make.outputs.make-cli == 'true' || needs.what-to-make.outputs.make-daemon == 'true' || needs.what-to-make.outputs.make-qt == 'true' || needs.what-to-make.outputs.make-tests == 'true' || needs.what-to-make.outputs.make-utils == 'true' }}
if: ${{ needs.what-to-make.outputs.make-cli == 'true' || needs.what-to-make.outputs.make-daemon == 'true' || needs.what-to-make.outputs.make-dist == 'true' || needs.what-to-make.outputs.make-qt == 'true' || needs.what-to-make.outputs.make-tests == 'true' || needs.what-to-make.outputs.make-utils == 'true' }}
strategy:
fail-fast: false
matrix:
@ -322,6 +324,7 @@ jobs:
choco uninstall `
openssl.light
(Join-Path $Env:ProgramFiles NASM) | Out-File $Env:GITHUB_PATH -Append
(Join-Path ${Env:ProgramFiles(x86)} 'WiX Toolset v3.11' bin) | Out-File $Env:GITHUB_PATH -Append
Install-Module -Name Pscx -RequiredVersion 4.0.0-beta4 -AllowPrerelease -Force
- name: Get Source
@ -365,12 +368,12 @@ jobs:
-DCMAKE_INSTALL_PREFIX=pfx `
-DCMAKE_PREFIX_PATH="${Env:DepsPrefix}" `
-DENABLE_CLI=${{ (needs.what-to-make.outputs.make-cli == 'true') && 'ON' || 'OFF' }} `
-DENABLE_DAEMON=${{ (needs.what-to-make.outputs.make-daemon == 'true') && 'ON' || 'OFF' }} `
-DENABLE_DAEMON=${{ (needs.what-to-make.outputs.make-daemon == 'true' || needs.what-to-make.outputs.make-dist == 'true') && 'ON' || 'OFF' }} `
-DENABLE_GTK=OFF `
-DENABLE_MAC=OFF `
-DENABLE_QT=${{ (needs.what-to-make.outputs.make-qt == 'true') && 'ON' || 'OFF' }} `
-DENABLE_QT=${{ (needs.what-to-make.outputs.make-dist == 'true' || needs.what-to-make.outputs.make-qt == 'true') && 'ON' || 'OFF' }} `
-DENABLE_TESTS=ON `
-DENABLE_UTILS=${{ (needs.what-to-make.outputs.make-utils == 'true') && 'ON' || 'OFF' }} `
-DENABLE_UTILS=${{ (needs.what-to-make.outputs.make-dist == 'true' || needs.what-to-make.outputs.make-utils == 'true') && 'ON' || 'OFF' }} `
-DENABLE_WEB=OFF `
-DRUN_CLANG_TIDY=OFF
- name: Make
@ -382,10 +385,18 @@ jobs:
run: cmake -E chdir obj ctest --build-config RelWithDebInfo --output-on-failure --timeout 600
- name: Install
run: cmake --build obj --config RelWithDebInfo --target install
- name: Package
run: |
Import-VisualStudioVars -VisualStudioVersion 2022 -Architecture ${{ matrix.arch }}
cmake --build obj --config RelWithDebInfo --target pack-msi
- uses: actions/upload-artifact@v3
with:
name: binaries-${{ github.job }}-${{ matrix.arch }}
path: pfx/**/*
- uses: actions/upload-artifact@v3
with:
name: binaries-${{ github.job }}-${{ matrix.arch }}-msi
path: obj/dist/msi/*.msi
make-source-tarball:
runs-on: ubuntu-22.04

View file

@ -12,6 +12,21 @@ set(VERSION "${TR_USER_AGENT_PREFIX}")
set(VERSION_MSI "${TR_VERSION_MAJOR}.${TR_VERSION_MINOR}.${TR_VERSION_PATCH}")
set(VERSION_FULL "${TR_USER_AGENT_PREFIX} (${TR_VCS_REVISION})")
if(MSVC_TOOLSET_VERSION MATCHES "^([0-9]+)([0-9])$")
set(MSVC_TOOLSET_VERSION_MAJOR ${CMAKE_MATCH_1})
set(MSVC_TOOLSET_VERSION_MINOR ${CMAKE_MATCH_2})
endif()
if(MSVC_TOOLSET_VERSION EQUAL 143)
set(MSVS_VERSION 17)
elseif(MSVC_TOOLSET_VERSION EQUAL 142)
set(MSVS_VERSION 16)
elseif(MSVC_TOOLSET_VERSION EQUAL 141)
set(MSVS_VERSION 15)
else()
message(FATAL_ERROR "Unsupported MSVC_TOOLSET_VERSION value: '${MSVC_TOOLSET_VERSION}'")
endif()
set(MSI_FILENAME_VERSION "${TR_SEMVER}")
if(NOT TR_STABLE_RELEASE AND NOT "${TR_VCS_REVISION}" STREQUAL "")
string(APPEND MSI_FILENAME_VERSION "+r${TR_VCS_REVISION}")
@ -25,8 +40,6 @@ if(NOT TR_QT_DIR)
set(TR_QT_DIR "$<TARGET_FILE_DIR:Qt${Qt_VERSION_MAJOR}::Core>/..")
endif()
find_msvc_crt_msm(TR_MSVC_CRT_MSM_FILE)
set(TR_OPENSSL_ARCH)
if(ARCH STREQUAL "x64")
set(TR_OPENSSL_ARCH "-x64")

View file

@ -38,11 +38,20 @@
UCRTINSTALLED
</Condition>
<Property Id="VCREDISTINSTALLED" Secure="yes">
<RegistrySearch Id="VcRedistInstalledRegSearch" Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\$(var.VcVerMajor).0\VC\Runtimes\$(sys.BUILDARCH)" Name="Installed" Type="raw"/>
</Property>
<Property Id="VCREDISTVERSIONMINOR" Secure="yes">
<RegistrySearch Id="VcRedistVersionMinorRegSearch" Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\$(var.VcVerMajor).0\VC\Runtimes\$(sys.BUILDARCH)" Name="Minor" Type="raw"/>
</Property>
<Condition Message="The Visual C++ Runtime is not installed or is outdated. Please download and install the latest version from here: https://aka.ms/vs/$(var.VsVerMajor)/release/vc_redist.$(sys.BUILDARCH).exe">
VCREDISTINSTALLED = "#1" AND VCREDISTVERSIONMINOR &gt;= "#$(var.VcVerMinor)0"
</Condition>
<Media Id="1" Cabinet="main.cab" EmbedCab="yes" DiskPrompt="CD-ROM #1" />
<Property Id="DiskPrompt" Value="Transmission $(var.TrVersion) Installation [1]" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Merge Id="VCRedist" SourceFile="$(var.MsvcCrtMsmFile)" DiskId="1" Language="0" />
<Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
<Directory Id="INSTALLDIR" Name="Transmission">
<Directory Id="WEBINSTALLDIR" Name="public_html" />
@ -53,9 +62,6 @@
</Directory>
<Feature Id="CompleteInstall" Title="Transmission" Level="1" AllowAdvertise="no" Display="expand" ConfigurableDirectory="INSTALLDIR">
<Feature Id="VCRedist" Title="Visual C++ Runtime" Level="1" AllowAdvertise="no" Display="hidden">
<MergeRef Id="VCRedist" />
</Feature>
<Feature Id="CommonLibs" Level="1" AllowAdvertise="no" Display="hidden">
<ComponentGroupRef Id="CommonLibsComponents" />
</Feature>

View file

@ -5,4 +5,8 @@
<?define TrVersionMsi = "${VERSION_MSI}" ?>
<?define TrVersionFull = "${VERSION_FULL}" ?>
<?define VcVerMajor = "${MSVC_TOOLSET_VERSION_MAJOR}" ?>
<?define VcVerMinor = "${MSVC_TOOLSET_VERSION_MINOR}" ?>
<?define VsVerMajor = "${MSVS_VERSION}" ?>
</Include>

View file

@ -7,16 +7,6 @@ function(find_msvc_crt_msm OUTPUT_VAR)
message(STATUS "Looking for a CRT MSM:")
if(NOT MSVC_TOOLSET_VERSION)
if(MSVC_VERSION GREATER_EQUAL 1920)
set(MSVC_TOOLSET_VERSION 142)
elseif(MSVC_VERSION GREATER_EQUAL 1910)
set(MSVC_TOOLSET_VERSION 141)
elseif(MSVC_VERSION GREATER_EQUAL 1900)
set(MSVC_TOOLSET_VERSION 140)
endif()
endif()
set(MSM_FILE "Microsoft_VC${MSVC_TOOLSET_VERSION}_CRT_${ARCH}.msm")
message(STATUS " * File name: ${MSM_FILE}")