diff --git a/.github/workflows/windows-artifacts.yml b/.github/workflows/windows-artifacts.yml index 71a1512855..f3b153f8ca 100644 --- a/.github/workflows/windows-artifacts.yml +++ b/.github/workflows/windows-artifacts.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - os: ['windows-2022'] + os: ['windows-2025'] go: ['1.24'] steps: - name: Check out repository code @@ -30,9 +30,8 @@ jobs: uses: actions/setup-go@v6 with: go-version: ${{ matrix.go }} - - name: Set path for heat.exe and light.exe - shell: bash - run: echo "$WIX\\bin" >>$GITHUB_PATH + - name: Install DotNet.SDK.10 + run: winget install --id Microsoft.DotNet.SDK.10 --source winget - name: Build Windows installer run: make out/windows-amd64/crc-windows-installer.zip - name: Upload windows installer artifact diff --git a/Makefile b/Makefile index 3dd093d825..575242c844 100644 --- a/Makefile +++ b/Makefile @@ -363,32 +363,21 @@ $(BUILD_DIR)/macos-universal/crc-macos-installer.tar: packagedir -e 's/__OPENSHIFT_VERSION__/'$(OPENSHIFT_VERSION)'/g' \ $< >$@ -$(HOST_BUILD_DIR)/GenMsiWxs: packaging/windows/gen_msi_wxs.go - go build -o $@ -ldflags="-X main.crcVersion=$(CRC_VERSION)" $< CRC_EXE=crc.exe -BUNDLE_NAME=crc_hyperv_$(OPENSHIFT_VERSION).$(BUNDLE_EXTENSION) - .PHONY: msidir -msidir: clean_windows_msi embed-download-windows $(HOST_BUILD_DIR)/GenMsiWxs windows-release-binary $(PACKAGE_DIR)/product.wxs.template - mkdir -p $(PACKAGE_DIR)/msi - cp $(EMBED_DOWNLOAD_DIR)/* $(PACKAGE_DIR)/msi - cp $(HOST_BUILD_DIR)/crc.exe $(PACKAGE_DIR)/msi/$(CRC_EXE) - $(HOST_BUILD_DIR)/GenMsiWxs - cp -r $(PACKAGE_DIR)/Resources $(PACKAGE_DIR)/msi/ - cp $(PACKAGE_DIR)/*.wxs $(PACKAGE_DIR)/msi - rm $(PACKAGE_DIR)/product.wxs +msidir: clean_windows_msi embed-download-windows windows-release-binary + cp $(EMBED_DOWNLOAD_DIR)/* $(PACKAGE_DIR)/ + cp $(HOST_BUILD_DIR)/crc.exe $(PACKAGE_DIR)/ $(BUILD_DIR)/windows-amd64/crc-windows-amd64.msi: msidir - candle.exe -arch x64 -ext WixUtilExtension -o $(PACKAGE_DIR)/msi/ $(PACKAGE_DIR)/msi/*.wxs - light.exe -ext WixUIExtension -ext WixUtilExtension -sacl -spdb -sice:ICE61 -sice:ICE69 -b $(PACKAGE_DIR)/msi -loc $(PACKAGE_DIR)/WixUI_en.wxl -out $@ $(PACKAGE_DIR)/msi/*.wixobj + dotnet build $(PACKAGE_DIR)/crc-installer.wixproj --property:DefineConstants="Version=$(CRC_VERSION)" --output $(HOST_BUILD_DIR) -CABS_MSI = "*.cab,crc-windows-amd64.msi" +MSI=$(HOST_BUILD_DIR)/crc-windows-amd64.msi $(BUILD_DIR)/windows-amd64/crc-windows-installer.zip: $(BUILD_DIR)/windows-amd64/crc-windows-amd64.msi rm -f $(HOST_BUILD_DIR)/crc.exe rm -f $(HOST_BUILD_DIR)/crc-embedder - rm -f $(HOST_BUILD_DIR)/split - pwsh -NoProfile -Command "cd $(HOST_BUILD_DIR); Compress-Archive -Path $(CABS_MSI) -DestinationPath crc-windows-installer.zip" + pwsh -NoProfile -Command 'Compress-Archive -Path "$(MSI)" -DestinationPath $(HOST_BUILD_DIR)/crc-windows-installer.zip' cd $(@D) && sha256sum $(@F)>$(@F).sha256sum .PHONY: choco choco-clean diff --git a/packaging/.gitignore b/packaging/.gitignore index 740f71a376..c5eb41fb5f 100644 --- a/packaging/.gitignore +++ b/packaging/.gitignore @@ -8,7 +8,6 @@ /darwin/VERSION /darwin/*.pkg /windows/msi/ -/windows/product.wxs /chocolatey/crc/*.nupkg /chocolatey/crc/crc.nuspec /chocolatey/crc/tools/*.exe diff --git a/packaging/windows/LicenseAgreementDlg_HK.wxs b/packaging/windows/LicenseAgreementDlg_HK.wxs index 7a39ef6567..2344f250b7 100755 --- a/packaging/windows/LicenseAgreementDlg_HK.wxs +++ b/packaging/windows/LicenseAgreementDlg_HK.wxs @@ -1,30 +1,18 @@ - - - + - + - - CostingComplete = 1 - "1"]]> - LicenseAccepted = "1" + + - 1 + - - - - - - - - 1 + @@ -34,3 +22,4 @@ + diff --git a/packaging/windows/WixUI_HK.wxs b/packaging/windows/WixUI_HK.wxs index 074dade06a..fc307f7092 100755 --- a/packaging/windows/WixUI_HK.wxs +++ b/packaging/windows/WixUI_HK.wxs @@ -1,5 +1,4 @@ - - + @@ -12,7 +11,6 @@ - @@ -25,48 +23,49 @@ - + - A previous version of Red Hat OpenShift Local is currently installed. By continuing the installation this version will be uninstalled. Do you want to continue? + - 1 + - 1 + - 1 + - - + + - 1 + - 1 - LicenseAccepted = "1" + + - NOT Installed - Installed + + - 1 + - 1 - 1 - 1 + + + - - + + - - + + + diff --git a/packaging/windows/WixUI_en.wxl b/packaging/windows/WixUI_en.wxl deleted file mode 100755 index 0d764e6671..0000000000 --- a/packaging/windows/WixUI_en.wxl +++ /dev/null @@ -1,3 +0,0 @@ - - The Setup Wizard will install [ProductName] at [INSTALLDIR] on your computer. Click Next to continue or Cancel to exit the Setup Wizard. - \ No newline at end of file diff --git a/packaging/windows/crc-installer.wixproj b/packaging/windows/crc-installer.wixproj new file mode 100644 index 0000000000..cc84c95e0f --- /dev/null +++ b/packaging/windows/crc-installer.wixproj @@ -0,0 +1,20 @@ + + + Package + crc-windows-amd64 + x64 + ICE61 + + + + false + false + false + + + + + + + + diff --git a/packaging/windows/gen_msi_wxs.go b/packaging/windows/gen_msi_wxs.go deleted file mode 100755 index 4b73e1b337..0000000000 --- a/packaging/windows/gen_msi_wxs.go +++ /dev/null @@ -1,45 +0,0 @@ -package main - -import ( - "log" - "os" - "strings" - "text/template" -) - -var crcVersion = "unset" // version set at compile time - -func main() { - if len(os.Args) != 1 { - log.Fatal("Split takes only one argument (the file to split)") - } - - if err := generateWxsFromTemplate(); err != nil { - log.Fatalf("Wxs generation failed: %s", err) - } -} - -func generateWxsFromTemplate() error { - tmpl := template.New("product.wxs.template") - tmpl.Funcs(template.FuncMap{ - "strjoin": strings.Join, - "inc": func(val int) int { return val + 1 }, - }) - tmpl, err := tmpl.ParseFiles("packaging/windows/product.wxs.template") - if err != nil { - return err - } - type templateData struct { - Version string - } - tmplData := templateData{ - Version: crcVersion, - } - - f, err := os.OpenFile("packaging/windows/product.wxs", os.O_CREATE|os.O_RDWR, 0644) - if err != nil { - return err - } - defer f.Close() - return tmpl.Execute(f, tmplData) -} diff --git a/packaging/windows/product.wxs b/packaging/windows/product.wxs new file mode 100755 index 0000000000..3be30b1892 --- /dev/null +++ b/packaging/windows/product.wxs @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packaging/windows/product.wxs.template b/packaging/windows/product.wxs.template deleted file mode 100755 index a04b19fd06..0000000000 --- a/packaging/windows/product.wxs.template +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - MINIMUMBUILD)]]> - - - - - - "Core")]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - NOT UPGRADINGPRODUCTCODE AND NOT WIX_UPGRADE_DETECTED - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED - NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED - Installed AND NOT PATCH AND REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE - NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED - NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED - Installed AND NOT UPGRADINGPRODUCTCODE - NOT Installed AND NOT REMOVE~="ALL" AND NOT WIX_UPGRADE_DETECTED - - - - - - - - - - - - - - - Creating crc-users group - Removing crc-users group - Installing Hyper-V - Adding user: [LogonUser] to Hyper-V Administrators group - Removing crcDaemon task - - - - - -