diff --git a/.pipelines/ESRPSigning_installer.json b/.pipelines/ESRPSigning_installer.json index cd96fb6f64..c9e505d3a2 100644 --- a/.pipelines/ESRPSigning_installer.json +++ b/.pipelines/ESRPSigning_installer.json @@ -4,7 +4,6 @@ "SignBatches": [ { "MatchedPath": [ - "PowerToysSetupCustomActions.dll", "PowerToysSetupCustomActionsVNext.dll", "SilentFilesInUseBAFunction.dll", "PowerToys*Setup-*.exe", diff --git a/.pipelines/installWiX.ps1 b/.pipelines/installWiX.ps1 deleted file mode 100644 index 3b6d783c85..0000000000 --- a/.pipelines/installWiX.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -$ProgressPreference = 'SilentlyContinue' - -$WixDownloadUrl = "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314.exe" -$WixBinariesDownloadUrl = "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip" - -# Download WiX binaries and verify their hash sums -Invoke-WebRequest -Uri $WixDownloadUrl -OutFile "$($ENV:Temp)\wix314.exe" -$Hash = (Get-FileHash -Algorithm SHA256 "$($ENV:Temp)\wix314.exe").Hash -if ($Hash -ne '6BF6D03D6923D9EF827AE1D943B90B42B8EBB1B0F68EF6D55F868FA34C738A29') -{ - Write-Error "$WixHash" - throw "wix314.exe has unexpected SHA256 hash: $Hash" -} -Invoke-WebRequest -Uri $WixBinariesDownloadUrl -OutFile "$($ENV:Temp)\wix314-binaries.zip" -$Hash = (Get-FileHash -Algorithm SHA256 "$($ENV:Temp)\wix314-binaries.zip").Hash -if($Hash -ne '6AC824E1642D6F7277D0ED7EA09411A508F6116BA6FAE0AA5F2C7DAA2FF43D31') -{ - throw "wix314-binaries.zip has unexpected SHA256 hash: $Hash" -} - -# Install WiX -Start-Process -Wait -FilePath "$($ENV:Temp)\wix314.exe" -ArgumentList "/install /quiet" - -# Extract WiX binaries and copy wix.targets to the installed dir -Expand-Archive -Path "$($ENV:Temp)\wix314-binaries.zip" -Force -DestinationPath "$($ENV:Temp)" -Copy-Item -Path "$($ENV:Temp)\wix.targets" -Destination "C:\Program Files (x86)\WiX Toolset v3.14\" \ No newline at end of file diff --git a/.pipelines/v2/release.yml b/.pipelines/v2/release.yml index 45514d4b0f..be92ae58b9 100644 --- a/.pipelines/v2/release.yml +++ b/.pipelines/v2/release.yml @@ -20,11 +20,6 @@ parameters: type: string default: '0.0.1' - - name: installerSuffix - type: string - displayName: "WiX5 installer suffix (e.g., 'wix5', 'vnext', etc.)" - default: "wix5" - - name: buildConfigurations displayName: "Build Configurations" type: object @@ -104,8 +99,7 @@ extends: useManagedIdentity: $(SigningUseManagedIdentity) clientId: $(SigningOriginalClientId) # Have msbuild use the release nuget config profile - installerSuffix: ${{ parameters.installerSuffix }} - additionalBuildOptions: /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:InstallerSuffix=${{ parameters.installerSuffix }} /p:EnableCmdPalAOT=true + additionalBuildOptions: /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:EnableCmdPalAOT=true beforeBuildSteps: # Sets versions for all PowerToy created DLLs - pwsh: |- diff --git a/.pipelines/v2/templates/job-build-project.yml b/.pipelines/v2/templates/job-build-project.yml index 6994c7a199..e043350edf 100644 --- a/.pipelines/v2/templates/job-build-project.yml +++ b/.pipelines/v2/templates/job-build-project.yml @@ -65,9 +65,6 @@ parameters: - name: versionNumber type: string default: '0.0.1' - - name: installerSuffix - type: string - default: "wix5" - name: useLatestWinAppSDK type: boolean default: false @@ -240,9 +237,7 @@ jobs: parameters: directory: $(build.sourcesdirectory)\src\modules\cmdpal - - pwsh: |- - & "$(build.sourcesdirectory)\.pipelines\installWiX.ps1" - displayName: Download and install WiX 3.14 development build + - ${{ parameters.beforeBuildSteps }} @@ -508,20 +503,7 @@ jobs: Copy-Item -Verbose -Force "$(CmdPalPackagePath)" "$(JobOutputDirectory)" displayName: Stage the final CmdPal package - - template: steps-build-installer.yml - parameters: - codeSign: ${{ parameters.codeSign }} - signingIdentity: ${{ parameters.signingIdentity }} - versionNumber: ${{ parameters.versionNumber }} - additionalBuildOptions: ${{ parameters.additionalBuildOptions }} - - template: steps-build-installer.yml - parameters: - codeSign: ${{ parameters.codeSign }} - signingIdentity: ${{ parameters.signingIdentity }} - versionNumber: ${{ parameters.versionNumber }} - additionalBuildOptions: ${{ parameters.additionalBuildOptions }} - buildUserInstaller: true # NOTE: This is the distinction between the above and below rules - template: steps-build-installer-vnext.yml parameters: @@ -529,7 +511,6 @@ jobs: signingIdentity: ${{ parameters.signingIdentity }} versionNumber: ${{ parameters.versionNumber }} additionalBuildOptions: ${{ parameters.additionalBuildOptions }} - installerSuffix: ${{ parameters.installerSuffix }} - template: steps-build-installer-vnext.yml parameters: @@ -537,7 +518,6 @@ jobs: signingIdentity: ${{ parameters.signingIdentity }} versionNumber: ${{ parameters.versionNumber }} additionalBuildOptions: ${{ parameters.additionalBuildOptions }} - installerSuffix: ${{ parameters.installerSuffix }} buildUserInstaller: true # NOTE: This is the distinction between the above and below rules # This saves ~1GiB per architecture. We won't need these later. @@ -576,17 +556,16 @@ jobs: - pwsh: |- $p = "$(JobOutputDirectory)\" - $installerSuffix = "${{ parameters.installerSuffix }}" - # Calculate hashes for regular installers (without custom suffix) - $userSetupFiles = Get-ChildItem -Path $p -Filter "PowerToysUserSetup*.exe" | Where-Object { $_.Name -notmatch "-$installerSuffix-" } - $machineSetupFiles = Get-ChildItem -Path $p -Filter "PowerToysSetup*.exe" | Where-Object { $_.Name -notmatch "-$installerSuffix-" -and $_.Name -notmatch "PowerToysUserSetup" } + # Calculate hashes for installers + $userSetupFiles = Get-ChildItem -Path $p -Filter "PowerToysUserSetup*.exe" + $machineSetupFiles = Get-ChildItem -Path $p -Filter "PowerToysSetup*.exe" | Where-Object { $_.Name -notmatch "PowerToysUserSetup" } if ($userSetupFiles.Count -gt 0) { $userHash = ($userSetupFiles[0] | Get-FileHash).Hash; $userPlat = "hash_user_$(BuildPlatform).txt"; $combinedUserPath = $p + $userPlat; - echo "Regular User: $userHash" + echo "User: $userHash" $userHash | out-file -filepath $combinedUserPath } @@ -594,29 +573,9 @@ jobs: $machineHash = ($machineSetupFiles[0] | Get-FileHash).Hash; $machinePlat = "hash_machine_$(BuildPlatform).txt"; $combinedMachinePath = $p + $machinePlat; - echo "Regular Machine: $machineHash" + echo "Machine: $machineHash" $machineHash | out-file -filepath $combinedMachinePath } - - # Calculate hashes for VNext installers (with custom suffix) - $userVNextFiles = Get-ChildItem -Path $p -Filter "PowerToysUserSetup*-$installerSuffix-*.exe" - $machineVNextFiles = Get-ChildItem -Path $p -Filter "PowerToysSetup*-$installerSuffix-*.exe" | Where-Object { $_.Name -notmatch "PowerToysUserSetup" } - - if ($userVNextFiles.Count -gt 0) { - $userVNextHash = ($userVNextFiles[0] | Get-FileHash).Hash; - $userVNextPlat = "hash_user_vnext_$(BuildPlatform).txt"; - $combinedUserVNextPath = $p + $userVNextPlat; - echo "VNext User: $userVNextHash" - $userVNextHash | out-file -filepath $combinedUserVNextPath - } - - if ($machineVNextFiles.Count -gt 0) { - $machineVNextHash = ($machineVNextFiles[0] | Get-FileHash).Hash; - $machineVNextPlat = "hash_machine_vnext_$(BuildPlatform).txt"; - $combinedMachineVNextPath = $p + $machineVNextPlat; - echo "VNext Machine: $machineVNextHash" - $machineVNextHash | out-file -filepath $combinedMachineVNextPath - } displayName: Calculate file hashes for all installers # Publishing the GPO files diff --git a/.pipelines/v2/templates/steps-build-installer-vnext.yml b/.pipelines/v2/templates/steps-build-installer-vnext.yml index 6db52ec631..882df8696a 100644 --- a/.pipelines/v2/templates/steps-build-installer-vnext.yml +++ b/.pipelines/v2/templates/steps-build-installer-vnext.yml @@ -14,9 +14,6 @@ parameters: - name: additionalBuildOptions type: string default: '' - - name: installerSuffix - type: string - default: "wix5" steps: # Install WiX 5.0.2 tools needed for VNext installer (matching project SDK) @@ -41,10 +38,10 @@ steps: # VNext bundle folder; base name intentionally omits the VNext suffix $InstallerFolder = 'PowerToysSetupVNext' if ($IsPerUser) { - $InstallerBasename = "PowerToysUserSetup-${{ parameters.versionNumber }}-${{ parameters.installerSuffix }}-$(BuildPlatform)" + $InstallerBasename = "PowerToysUserSetup-${{ parameters.versionNumber }}-$(BuildPlatform)" } else { - $InstallerBasename = "PowerToysSetup-${{ parameters.versionNumber }}-${{ parameters.installerSuffix }}-$(BuildPlatform)" + $InstallerBasename = "PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform)" } # Export variables for downstream steps @@ -63,7 +60,6 @@ steps: msbuildArgs: >- /t:PowerToysSetupCustomActionsVNext /p:RunBuildEvents=true;PerUser=${{parameters.buildUserInstaller}};RestorePackagesConfig=true;CIBuild=true - /p:InstallerSuffix=${{ parameters.installerSuffix }} -restore -graph /bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-actions.binlog ${{ parameters.additionalBuildOptions }} @@ -95,7 +91,6 @@ steps: -restore /t:PowerToysInstallerVNext /p:RunBuildEvents=false;PerUser=${{parameters.buildUserInstaller}};BuildProjectReferences=false;CIBuild=true - /p:InstallerSuffix=${{ parameters.installerSuffix }} /bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-msi.binlog ${{ parameters.additionalBuildOptions }} platform: $(BuildPlatform) @@ -142,7 +137,6 @@ steps: msbuildArgs: >- /t:SilentFilesInUseBAFunction /p:RunBuildEvents=true;PerUser=${{parameters.buildUserInstaller}};RestorePackagesConfig=true;CIBuild=true - /p:InstallerSuffix=${{ parameters.installerSuffix }} -restore -graph /bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-SilentFilesInUseBAFunction.binlog ${{ parameters.additionalBuildOptions }} @@ -175,7 +169,6 @@ steps: -restore /t:PowerToysBootstrapperVNext /p:PerUser=${{parameters.buildUserInstaller}};CIBuild=true - /p:InstallerSuffix=${{ parameters.installerSuffix }} /bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-bootstrapper.binlog -restore -graph ${{ parameters.additionalBuildOptions }} diff --git a/.pipelines/v2/templates/steps-build-installer.yml b/.pipelines/v2/templates/steps-build-installer.yml deleted file mode 100644 index 8c3c89dbc0..0000000000 --- a/.pipelines/v2/templates/steps-build-installer.yml +++ /dev/null @@ -1,208 +0,0 @@ -parameters: - - name: versionNumber - type: string - default: "0.0.1" - - name: buildUserInstaller - type: boolean - default: false - - name: codeSign - type: boolean - default: false - - name: signingIdentity - type: object - default: {} - - name: additionalBuildOptions - type: string - default: '' - -steps: - - pwsh: |- - & git clean -xfd -e *exe -- .\installer\ - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Clean installer to reduce cross-contamination - - - pwsh: |- - $IsPerUser = $${{ parameters.buildUserInstaller }} - $InstallerBuildSlug = "MachineSetup" - $InstallerBasename = "PowerToysSetup" - If($IsPerUser) { - $InstallerBuildSlug = "UserSetup" - $InstallerBasename = "PowerToysUserSetup" - } - $InstallerBasename += "-${{ parameters.versionNumber }}-$(BuildPlatform)" - Write-Host "##vso[task.setvariable variable=InstallerBuildSlug]$InstallerBuildSlug" - Write-Host "##vso[task.setvariable variable=InstallerRelativePath]$(BuildPlatform)\$(BuildConfiguration)\$InstallerBuildSlug" - Write-Host "##vso[task.setvariable variable=InstallerBasename]$InstallerBasename" - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Prepare Installer variables - - # This dll needs to be built and signed before building the MSI. - - task: VSBuild@1 - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build PowerToysSetupCustomActions - inputs: - solution: "**/installer/PowerToysSetup.sln" - vsVersion: 17.0 - msbuildArgs: >- - /t:PowerToysSetupCustomActions - /p:RunBuildEvents=true;PerUser=${{parameters.buildUserInstaller}};RestorePackagesConfig=true;CIBuild=true - -restore -graph - /bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-actions.binlog - ${{ parameters.additionalBuildOptions }} - platform: $(BuildPlatform) - configuration: $(BuildConfiguration) - clean: true - msbuildArchitecture: x64 - maximumCpuCount: true - - - ${{ if eq(parameters.codeSign, true) }}: - - template: steps-esrp-signing.yml - parameters: - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign PowerToysSetupCustomActions - signingIdentity: ${{ parameters.signingIdentity }} - inputs: - FolderPath: 'installer/PowerToysSetupCustomActions/$(InstallerRelativePath)' - signType: batchSigning - batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' - ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' - - ## INSTALLER START - #### MSI BUILDING AND SIGNING - - task: VSBuild@1 - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build MSI - inputs: - solution: "**/installer/PowerToysSetup.sln" - vsVersion: 17.0 - msbuildArgs: >- - -restore - /t:PowerToysInstaller - /p:RunBuildEvents=false;PerUser=${{parameters.buildUserInstaller}};BuildProjectReferences=false;CIBuild=true - /bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-msi.binlog - ${{ parameters.additionalBuildOptions }} - platform: $(BuildPlatform) - configuration: $(BuildConfiguration) - clean: false # don't undo our hard work above by deleting the CustomActions dll - msbuildArchitecture: x64 - maximumCpuCount: true - - - script: |- - "C:\Program Files (x86)\WiX Toolset v3.14\bin\dark.exe" -x $(build.sourcesdirectory)\extractedMsi installer\PowerToysSetup\$(InstallerRelativePath)\$(InstallerBasename).msi - dir $(build.sourcesdirectory)\extractedMsi - displayName: "${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Extract and verify MSI" - - # Extract CmdPal msix package to check if its content is signed - - pwsh: |- - Write-Host "Extracting CmdPal MSIX package" - - # Define the directory to search - $searchDir = "extractedMsi\File" - - # Define the regex pattern for MSIX files - $pattern = '^Microsoft.CmdPal.UI.*\.msix$' - - # Get all files in the directory and subdirectories - $msixFile = Get-ChildItem -Path $searchDir -Recurse -File | Where-Object { - $_.Name -match $pattern - } - - Write-Host "MSIX file found: " $msixFile - - $destinationDir = "$(build.sourcesdirectory)\extractedMsi\File\extractedCmdPalMsix" - - Expand-Archive -Path $msixFile -DestinationPath $destinationDir - Get-ChildItem -Path $destinationDir -Recurse -File - - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Extract CmdPal MSIX package - - # Check if deps.json files don't reference different dll versions. - - pwsh: |- - & '.pipelines/verifyDepsJsonLibraryVersions.ps1' -targetDir '$(build.sourcesdirectory)\extractedMsi\File' - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Audit deps.json in MSI extracted files - - - ${{ if eq(parameters.codeSign, true) }}: - - pwsh: |- - & .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedMsi\File' - & .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedMsi\Binary' - git clean -xfd ./extractedMsi - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Verify all binaries are signed and versioned - - - template: steps-esrp-signing.yml - parameters: - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign MSI - signingIdentity: ${{ parameters.signingIdentity }} - inputs: - FolderPath: 'installer/PowerToysSetup/$(InstallerRelativePath)' - signType: batchSigning - batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' - ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' - - #### END MSI - #### BOOTSTRAP BUILDING AND SIGNING - - - task: VSBuild@1 - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build Bootstrapper - inputs: - solution: "**/installer/PowerToysSetup.sln" - vsVersion: 17.0 - msbuildArgs: >- - /t:PowerToysBootstrapper - /p:PerUser=${{parameters.buildUserInstaller}};CIBuild=true - /bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-bootstrapper.binlog - -restore -graph - ${{ parameters.additionalBuildOptions }} - platform: $(BuildPlatform) - configuration: $(BuildConfiguration) - clean: false # don't undo our hard work above by deleting the MSI - msbuildArchitecture: x64 - maximumCpuCount: true - - # The entirety of bundle unpacking/re-packing is unnecessary if we are not code signing it. - - ${{ if eq(parameters.codeSign, true) }}: - - script: |- - "C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ib installer\PowerToysSetup\$(InstallerRelativePath)\$(InstallerBasename).exe -o installer\engine.exe - displayName: "${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Insignia: Extract Engine from Bundle" - - - template: steps-esrp-signing.yml - parameters: - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign WiX Engine - signingIdentity: ${{ parameters.signingIdentity }} - inputs: - FolderPath: "installer" - Pattern: engine.exe - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolSign", - "Parameters": { - "OpusName": "Microsoft", - "OpusInfo": "http://www.microsoft.com", - "FileDigest": "/fd \"SHA256\"", - "PageHash": "/NPH", - "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - - - script: |- - "C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ab installer\engine.exe installer\PowerToysSetup\$(InstallerRelativePath)\$(InstallerBasename).exe -o installer\PowerToysSetup\$(InstallerRelativePath)\$(InstallerBasename).exe - displayName: "${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Insignia: Merge Engine into Bundle" - - - template: steps-esrp-signing.yml - parameters: - displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign Final Bootstrapper - signingIdentity: ${{ parameters.signingIdentity }} - inputs: - FolderPath: 'installer/PowerToysSetup/$(InstallerRelativePath)' - signType: batchSigning - batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' - ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' - #### END BOOTSTRAP - ## END INSTALLER diff --git a/doc/devdocs/core/installer.md b/doc/devdocs/core/installer.md index 8e9f008f2e..5bcbb0f87c 100644 --- a/doc/devdocs/core/installer.md +++ b/doc/devdocs/core/installer.md @@ -1,6 +1,6 @@ # PowerToys Installer -## Installer Architecture (WiX 3/ WiX 5) +## Installer Architecture (WiX 5) - Uses a bootstrapper to check dependencies and close PowerToys - MSI defined in product.wxs @@ -22,7 +22,7 @@ ### MSI Installer Build Process -- First builds `PowerToysSetupCustomActions` DLL and signs it, for WiX5 project, installer will build `PowerToysSetupCustomActionsVNext` DLL. +- First builds `PowerToysSetupCustomActionsVNext` DLL and signs it - Then builds the installer without cleaning, to reuse the signed DLL - Uses PowerShell scripts to modify .wxs files before build - Restores original .wxs files after build completes @@ -96,9 +96,14 @@ The following manual steps will not install the MSIX apps (such as Command Palet #### Prerequisites for building the MSI installer -1. Install the [WiX Toolset Visual Studio 2022 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2022Extension). -1. Install the [WiX Toolset build tools](https://github.com/wixtoolset/wix3/releases/tag/wix3141rtm). (installer [direct link](https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314.exe)) -1. Download [WiX binaries](https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip) and extract `wix.targets` to `C:\Program Files (x86)\WiX Toolset v3.14`. +PowerToys uses WiX v5 for creating installers. The WiX v5 tools are automatically installed during the build process via dotnet tool. + +For manual installation of WiX v5 tools: +```powershell +dotnet tool install --global wix --version 5.0.2 +``` + +> **Note:** As of release 0.94, PowerToys has migrated from WiX v3 to WiX v5. The WiX v3 toolset is no longer required. #### Building prerequisite projects @@ -133,17 +138,9 @@ If you prefer, you can alternatively build prerequisite projects for the install 1. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release` 1. From the `Build` menu choose `Build Solution`. -The resulting `PowerToysSetup.msi` installer will be available in the `installer\PowerToysSetup\x64\Release\` folder. +The resulting installer will be available in the `installer\PowerToysSetupVNext\x64\Release\` folder. -For WiX3 project, run `Developer Command Prompt for VS 2022` in admin mode and execute the following command to build the installer. The generated installer package will be located at `\installer\PowerToysSetup\{platform}\Release\MachineSetup`. - -``` -git clean -xfd -e *exe -- .\installer\ -MSBuild -t:restore .\installer\PowerToysSetup.sln -p:RestorePackagesConfig=true /p:Platform="x64" /p:Configuration=Release -MSBuild -m .\installer\PowerToysSetup.sln /t:PowerToysInstaller /p:Configuration=Release /p:Platform="x64" -MSBuild -m .\installer\PowerToysSetup.sln /t:PowerToysBootstrapper /p:Configuration=Release /p:Platform="x64" -``` -For WiX5 project, run `Developer Command Prompt for VS 2022` in admin mode and execute the following command to build the installer. The generated installer package will be located at `\installer\PowerToysSetupVNext\{platform}\Release\MachineSetup`. +To build the installer from the command line, run `Developer Command Prompt for VS 2022` in admin mode and execute the following commands. The generated installer package will be located at `\installer\PowerToysSetupVNext\{platform}\Release\MachineSetup`. ``` git clean -xfd -e *exe -- .\installer\ diff --git a/installer/PowerToysSetup.sln b/installer/PowerToysSetup.sln index 47d0c56070..77d38c94ab 100644 --- a/installer/PowerToysSetup.sln +++ b/installer/PowerToysSetup.sln @@ -2,16 +2,10 @@ # Visual Studio Version 17 VisualStudioVersion = 17.1.32414.318 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "PowerToysInstaller", "PowerToysSetup\PowerToysInstaller.wixproj", "{022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerToysSetupCustomActions", "PowerToysSetupCustomActions\PowerToysSetupCustomActions.vcxproj", "{32F3882B-F2D6-4586-B5ED-11E39E522BD3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spdlog", "..\src\logging\logging.vcxproj", "{7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logger", "..\src\common\logger\logger.vcxproj", "{D9B8FC84-322A-4F9F-BBB9-20915C47DDFD}" EndProject -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "PowerToysBootstrapper", "PowerToysSetup\PowerToysBootstrapper.wixproj", "{31D72625-43C1-41B1-B784-BCE4A8DC5543}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Version", "..\src\common\version\version.vcxproj", "{CC6E41AC-8174-4E8A-8D22-85DD7F4851DF}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EtwTrace", "..\src\common\Telemetry\EtwTrace\EtwTrace.vcxproj", "{8F021B46-362B-485C-BFBA-CCF83E820CBD}" @@ -32,21 +26,6 @@ Global Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}.Debug|ARM64.Build.0 = Debug|ARM64 - {022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}.Debug|x64.ActiveCfg = Debug|x64 - {022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}.Debug|x64.Build.0 = Debug|x64 - {022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}.Release|ARM64.ActiveCfg = Release|ARM64 - {022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}.Release|ARM64.Build.0 = Release|ARM64 - {022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}.Release|x64.ActiveCfg = Release|x64 - {022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}.Release|x64.Build.0 = Release|x64 - {32F3882B-F2D6-4586-B5ED-11E39E522BD3}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {32F3882B-F2D6-4586-B5ED-11E39E522BD3}.Debug|x64.ActiveCfg = Debug|x64 - {32F3882B-F2D6-4586-B5ED-11E39E522BD3}.Debug|x64.Build.0 = Debug|x64 - {32F3882B-F2D6-4586-B5ED-11E39E522BD3}.Release|ARM64.ActiveCfg = Release|ARM64 - {32F3882B-F2D6-4586-B5ED-11E39E522BD3}.Release|ARM64.Build.0 = Release|ARM64 - {32F3882B-F2D6-4586-B5ED-11E39E522BD3}.Release|x64.ActiveCfg = Release|x64 - {32F3882B-F2D6-4586-B5ED-11E39E522BD3}.Release|x64.Build.0 = Release|x64 {7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F}.Debug|ARM64.ActiveCfg = Debug|ARM64 {7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F}.Debug|x64.ActiveCfg = Debug|x64 {7E1E3F13-2BD6-3F75-A6A7-873A2B55C60F}.Debug|x64.Build.0 = Debug|x64 @@ -61,14 +40,6 @@ Global {D9B8FC84-322A-4F9F-BBB9-20915C47DDFD}.Release|ARM64.Build.0 = Release|ARM64 {D9B8FC84-322A-4F9F-BBB9-20915C47DDFD}.Release|x64.ActiveCfg = Release|x64 {D9B8FC84-322A-4F9F-BBB9-20915C47DDFD}.Release|x64.Build.0 = Release|x64 - {31D72625-43C1-41B1-B784-BCE4A8DC5543}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {31D72625-43C1-41B1-B784-BCE4A8DC5543}.Debug|ARM64.Build.0 = Debug|ARM64 - {31D72625-43C1-41B1-B784-BCE4A8DC5543}.Debug|x64.ActiveCfg = Debug|x64 - {31D72625-43C1-41B1-B784-BCE4A8DC5543}.Debug|x64.Build.0 = Debug|x64 - {31D72625-43C1-41B1-B784-BCE4A8DC5543}.Release|ARM64.ActiveCfg = Release|ARM64 - {31D72625-43C1-41B1-B784-BCE4A8DC5543}.Release|ARM64.Build.0 = Release|ARM64 - {31D72625-43C1-41B1-B784-BCE4A8DC5543}.Release|x64.ActiveCfg = Release|x64 - {31D72625-43C1-41B1-B784-BCE4A8DC5543}.Release|x64.Build.0 = Release|x64 {CC6E41AC-8174-4E8A-8D22-85DD7F4851DF}.Debug|ARM64.ActiveCfg = Debug|ARM64 {CC6E41AC-8174-4E8A-8D22-85DD7F4851DF}.Debug|ARM64.Build.0 = Debug|ARM64 {CC6E41AC-8174-4E8A-8D22-85DD7F4851DF}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/installer/PowerToysSetup/AdvancedPaste.wxs b/installer/PowerToysSetup/AdvancedPaste.wxs deleted file mode 100644 index a865ddbf6c..0000000000 --- a/installer/PowerToysSetup/AdvancedPaste.wxs +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Awake.wxs b/installer/PowerToysSetup/Awake.wxs deleted file mode 100644 index a8f5536ff4..0000000000 --- a/installer/PowerToysSetup/Awake.wxs +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/BaseApplications.wxs b/installer/PowerToysSetup/BaseApplications.wxs deleted file mode 100644 index 134a3ee89a..0000000000 --- a/installer/PowerToysSetup/BaseApplications.wxs +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/CmdPal.wxs b/installer/PowerToysSetup/CmdPal.wxs deleted file mode 100644 index cce523e8b4..0000000000 --- a/installer/PowerToysSetup/CmdPal.wxs +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/ColorPicker.wxs b/installer/PowerToysSetup/ColorPicker.wxs deleted file mode 100644 index 0c744a7b26..0000000000 --- a/installer/PowerToysSetup/ColorPicker.wxs +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Common.wxi b/installer/PowerToysSetup/Common.wxi deleted file mode 100644 index 21855a7936..0000000000 --- a/installer/PowerToysSetup/Common.wxi +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Core.wxs b/installer/PowerToysSetup/Core.wxs deleted file mode 100644 index eb39fdc9db..0000000000 --- a/installer/PowerToysSetup/Core.wxs +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSTALLDESKTOPSHORTCUT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/CustomDialogs/PTInstallDirDlg.wxs b/installer/PowerToysSetup/CustomDialogs/PTInstallDirDlg.wxs deleted file mode 100644 index d5697ec631..0000000000 --- a/installer/PowerToysSetup/CustomDialogs/PTInstallDirDlg.wxs +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/CustomDialogs/PTLicenseDlg.wxs b/installer/PowerToysSetup/CustomDialogs/PTLicenseDlg.wxs deleted file mode 100644 index ee7b752591..0000000000 --- a/installer/PowerToysSetup/CustomDialogs/PTLicenseDlg.wxs +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - 1 - - - - !(wix.WixUICostingPopupOptOut) OR CostingComplete = 1 - - - 1 - - - - - - - - \ No newline at end of file diff --git a/installer/PowerToysSetup/CustomDialogs/WixUI_PTInstallDir.wxs b/installer/PowerToysSetup/CustomDialogs/WixUI_PTInstallDir.wxs deleted file mode 100644 index a06d1ed278..0000000000 --- a/installer/PowerToysSetup/CustomDialogs/WixUI_PTInstallDir.wxs +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - "1"]]> - - 1 - - NOT Installed - Installed AND PATCH - - 1 - 1 - - 1 - 1 - NOT WIXUI_DONTVALIDATEPATH - "1"]]> - WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1" - 1 - 1 - NOT Installed - Installed AND NOT PATCH - Installed AND PATCH - - 1 - - 1 - 1 - 1 - - - - - diff --git a/installer/PowerToysSetup/EnvironmentVariables.wxs b/installer/PowerToysSetup/EnvironmentVariables.wxs deleted file mode 100644 index 44567055af..0000000000 --- a/installer/PowerToysSetup/EnvironmentVariables.wxs +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/FileExplorerPreview.wxs b/installer/PowerToysSetup/FileExplorerPreview.wxs deleted file mode 100644 index 0a92d94c3e..0000000000 --- a/installer/PowerToysSetup/FileExplorerPreview.wxs +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/FileLocksmith.wxs b/installer/PowerToysSetup/FileLocksmith.wxs deleted file mode 100644 index 5943ab4147..0000000000 --- a/installer/PowerToysSetup/FileLocksmith.wxs +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Hosts.wxs b/installer/PowerToysSetup/Hosts.wxs deleted file mode 100644 index cb86aa8e11..0000000000 --- a/installer/PowerToysSetup/Hosts.wxs +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/ImageResizer.wxs b/installer/PowerToysSetup/ImageResizer.wxs deleted file mode 100644 index 67b5acf198..0000000000 --- a/installer/PowerToysSetup/ImageResizer.wxs +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Images/banner.png b/installer/PowerToysSetup/Images/banner.png deleted file mode 100644 index 25f878ee82..0000000000 Binary files a/installer/PowerToysSetup/Images/banner.png and /dev/null differ diff --git a/installer/PowerToysSetup/Images/dialog.png b/installer/PowerToysSetup/Images/dialog.png deleted file mode 100644 index b422990982..0000000000 Binary files a/installer/PowerToysSetup/Images/dialog.png and /dev/null differ diff --git a/installer/PowerToysSetup/Images/logo.png b/installer/PowerToysSetup/Images/logo.png deleted file mode 100644 index c9f9405405..0000000000 Binary files a/installer/PowerToysSetup/Images/logo.png and /dev/null differ diff --git a/installer/PowerToysSetup/Images/logo150.png b/installer/PowerToysSetup/Images/logo150.png deleted file mode 100644 index 35e757d8e5..0000000000 Binary files a/installer/PowerToysSetup/Images/logo150.png and /dev/null differ diff --git a/installer/PowerToysSetup/Images/logo44.png b/installer/PowerToysSetup/Images/logo44.png deleted file mode 100644 index b931931dff..0000000000 Binary files a/installer/PowerToysSetup/Images/logo44.png and /dev/null differ diff --git a/installer/PowerToysSetup/KeyboardManager.wxs b/installer/PowerToysSetup/KeyboardManager.wxs deleted file mode 100644 index dc216ccde3..0000000000 --- a/installer/PowerToysSetup/KeyboardManager.wxs +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/MouseWithoutBorders.wxs b/installer/PowerToysSetup/MouseWithoutBorders.wxs deleted file mode 100644 index 8a5efa1f8d..0000000000 --- a/installer/PowerToysSetup/MouseWithoutBorders.wxs +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/NewPlus.wxs b/installer/PowerToysSetup/NewPlus.wxs deleted file mode 100644 index 624c01fca2..0000000000 --- a/installer/PowerToysSetup/NewPlus.wxs +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Peek.wxs b/installer/PowerToysSetup/Peek.wxs deleted file mode 100644 index f87794e945..0000000000 --- a/installer/PowerToysSetup/Peek.wxs +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/PowerRename.wxs b/installer/PowerToysSetup/PowerRename.wxs deleted file mode 100644 index 7aa357e207..0000000000 --- a/installer/PowerToysSetup/PowerRename.wxs +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/PowerToys.wxs b/installer/PowerToysSetup/PowerToys.wxs deleted file mode 100644 index 2e50d278fb..0000000000 --- a/installer/PowerToysSetup/PowerToys.wxs +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MinimumVersion >= DetectedPowerToysVersion - TargetPowerToysVersion >= DetectedPowerToysUserVersion OR WixBundleInstalled - - MinimumVersion >= DetectedPowerToysUserVersion - TargetPowerToysVersion >= DetectedPowerToysVersion OR WixBundleInstalled - - - - - DetectedWindowsBuildNumber >= 19041 OR WixBundleInstalled - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/PowerToysBootstrapper.wixproj b/installer/PowerToysSetup/PowerToysBootstrapper.wixproj deleted file mode 100644 index b2f5945dc2..0000000000 --- a/installer/PowerToysSetup/PowerToysBootstrapper.wixproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - Version=$(Version) - PowerToysBootstrapper - {31d72625-43c1-41b1-b784-bce4a8dc5543} - - - $(DefineConstants);PerUser=true - - - $(DefineConstants);PerUser=false - - - $(DefineConstants);CIBuild=true - - - $(DefineConstants);CIBuild=false - - - Release - x64 - arm64 - 3.10 - 2.0 - PowerToysSetup-$(Version)-$(Platform) - Bundle - True - PowerToysSetup-$(Version)-$(Platform) - PowerToysUserSetup-$(Version)-$(Platform) - $(Platform)\$(Configuration)\MachineSetup - $(Platform)\$(Configuration)\UserSetup - obj\$(Platform)\$(Configuration)\ - - - - - - - - $(WixExtDir)\WixUtilExtension.dll - WixUtilExtension - - - $(WixExtDir)\WixUIExtension.dll - WixUIExtension - - - $(WixExtDir)\WixNetFxExtension.dll - WixNetFxExtension - - - $(WixExtDir)\WixBalExtension.dll - WixBalExtension - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - <_ValidProjectsForRestore Include="$(MSBuildProjectFullPath)" /> - - - - \ No newline at end of file diff --git a/installer/PowerToysSetup/PowerToysInstaller.wixproj b/installer/PowerToysSetup/PowerToysInstaller.wixproj deleted file mode 100644 index 4a391eb901..0000000000 --- a/installer/PowerToysSetup/PowerToysInstaller.wixproj +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - Version=$(Version);MonacoSRCHarvestPath=$(ProjectDir)..\..\x64\$(Configuration)\Assets\Monaco\monacoSRC;CmdPalVersion=$(CmdPalVersion) - - IF NOT DEFINED IsPipeline ( -call "$([MSBuild]::GetVsInstallRoot())\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.19041.0 -vcvars_ver=$(VCToolsVersion) -SET PTRoot=$(SolutionDir)\.. -call "..\..\..\publish.cmd" x64 -) -call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuildThisFileDirectory)\generateMonacoWxs.ps1 -monacoWxsFile "$(MSBuildThisFileDirectory)\MonacoSRC.wxs" -call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuildThisFileDirectory)\generateDscResourcesWxs.ps1 -dscWxsFile "$(MSBuildThisFileDirectory)\DscResources.wxs" -Platform "$(Platform)" -Configuration "$(Configuration)" - - - - Version=$(Version);MonacoSRCHarvestPath=$(ProjectDir)..\..\ARM64\$(Configuration)\Assets\Monaco\monacoSRC;CmdPalVersion=$(CmdPalVersion); - IF NOT DEFINED IsPipeline ( -call "$([MSBuild]::GetVsInstallRoot())\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=amd64 -winsdk=10.0.19041.0 -vcvars_ver=$(VCToolsVersion) -SET PTRoot=$(SolutionDir)\.. -call "..\..\..\publish.cmd" arm64 -) -call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuildThisFileDirectory)\generateMonacoWxs.ps1 -monacoWxsFile "$(MSBuildThisFileDirectory)\MonacoSRC.wxs" -call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuildThisFileDirectory)\generateDscResourcesWxs.ps1 -dscWxsFile "$(MSBuildThisFileDirectory)\DscResources.wxs" -Platform "$(Platform)" -Configuration "$(Configuration)" - - - - Always - - call move /Y ..\..\..\AdvancedPaste.wxs.bk ..\..\..\AdvancedPaste.wxs - call move /Y ..\..\..\Awake.wxs.bk ..\..\..\Awake.wxs - call move /Y ..\..\..\BaseApplications.wxs.bk ..\..\..\BaseApplications.wxs - call move /Y ..\..\..\CmdPal.wxs.bk ..\..\..\CmdPal.wxs - call move /Y ..\..\..\ColorPicker.wxs.bk ..\..\..\ColorPicker.wxs - call move /Y ..\..\..\Core.wxs.bk ..\..\..\Core.wxs - call move /Y ..\..\..\EnvironmentVariables.wxs.bk ..\..\..\EnvironmentVariables.wxs - call move /Y ..\..\..\FileExplorerPreview.wxs.bk ..\..\..\FileExplorerPreview.wxs - call move /Y ..\..\..\FileLocksmith.wxs.bk ..\..\..\FileLocksmith.wxs - call move /Y ..\..\..\Hosts.wxs.bk ..\..\..\Hosts.wxs - call move /Y ..\..\..\ImageResizer.wxs.bk ..\..\..\ImageResizer.wxs - call move /Y ..\..\..\KeyboardManager.wxs.bk ..\..\..\KeyboardManager.wxs - call move /Y ..\..\..\MouseWithoutBorders.wxs.bk ..\..\..\MouseWithoutBorders.wxs - call move /Y ..\..\..\NewPlus.wxs.bk ..\..\..\NewPlus.wxs - call move /Y ..\..\..\Peek.wxs.bk ..\..\..\Peek.wxs - call move /Y ..\..\..\PowerRename.wxs.bk ..\..\..\PowerRename.wxs - call move /Y ..\..\..\Product.wxs.bk ..\..\..\Product.wxs - call move /Y ..\..\..\RegistryPreview.wxs.bk ..\..\..\RegistryPreview.wxs - call move /Y ..\..\..\Resources.wxs.bk ..\..\..\Resources.wxs - call move /Y ..\..\..\Run.wxs.bk ..\..\..\Run.wxs - call move /Y ..\..\..\Settings.wxs.bk ..\..\..\Settings.wxs - call move /Y ..\..\..\ShortcutGuide.wxs.bk ..\..\..\ShortcutGuide.wxs - call move /Y ..\..\..\Tools.wxs.bk ..\..\..\Tools.wxs - call move /Y ..\..\..\WinAppSDK.wxs.bk ..\..\..\WinAppSDK.wxs - call move /Y ..\..\..\WinUI3Applications.wxs.bk ..\..\..\WinUI3Applications.wxs - call move /Y ..\..\..\Workspaces.wxs.bk ..\..\..\Workspaces.wxs - - - - PowerToysInstaller - - - $(DefineConstants);PerUser=true - - - $(DefineConstants);PerUser=false - - - $(DefineConstants);CIBuild=true - - - $(DefineConstants);CIBuild=false - - - - Release - $(Platform) - 3.10 - 022a9d30-7c4f-416d-a9df-5ff2661cc0ad - 2.0 - PowerToysSetup-$(Version)-$(Platform) - PowerToysUserSetup-$(Version)-$(Platform) - Package - True - - - - - ICE91 - 1026;1076 - - - $(Platform)\$(Configuration)\MachineSetup - $(Platform)\$(Configuration)\UserSetup - obj\$(Platform)\$(Configuration)\MachineSetup - obj\$(Platform)\$(Configuration)\UserSetup - ICE40 - - - - - -v -sh -sw1108 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(WixExtDir)\WixFirewallExtension.dll - WixFirewallExtension - - - $(WixExtDir)\WixUtilExtension.dll - WixUtilExtension - - - $(WixExtDir)\WixUIExtension.dll - WixUIExtension - - - $(WixExtDir)\WixNetFxExtension.dll - WixNetFxExtension - - - - - - - - PowerToysSetupCustomActions - {32f3882b-f2d6-4586-b5ed-11e39e522bd3} - True - True - Binaries;Content;Satellites - INSTALLFOLDER - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - <_ValidProjectsForRestore Include="$(MSBuildProjectFullPath)" /> - - - - diff --git a/installer/PowerToysSetup/Product.wxs b/installer/PowerToysSetup/Product.wxs deleted file mode 100644 index c7f9d3bda4..0000000000 --- a/installer/PowerToysSetup/Product.wxs +++ /dev/null @@ -1,540 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - = 19041)]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - - NOT Installed - 1 - NOT Installed - NOT Installed - Installed AND _REMOVE_ALL="Yes" - Installed AND _REMOVE_ALL="Yes" - Installed AND NOT (_REMOVE_ALL="Yes") - Installed AND NOT (_REMOVE_ALL="Yes") - - - - - - - - - - - - - - - - - ""]]> - - - DEFAULTBOOTSTRAPPERINSTALLFOLDER OR PREVIOUSINSTALLFOLDER = ""]]> - - - - - - - - - - - - - - - - - - NOT Installed - - - NOT Installed - - - NOT Installed - - - - - - - - - - NOT Installed - - - Installed and (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") - - - Installed AND (REMOVE="ALL") - - - Installed AND (REMOVE="ALL") - - - Installed AND (REMOVE="ALL") - - - Installed AND (REMOVE="ALL") - - - Installed AND (REMOVE="ALL") - - - Installed AND (REMOVE="ALL") - - - Installed AND (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") - - - Installed AND (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") - - - Installed AND (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") - - - WIX_UPGRADE_DETECTED - - - Installed AND (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") - - - - - - Installed AND (REMOVE="ALL") - - - - NOT Installed - - - NOT Installed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/RegistryPreview.wxs b/installer/PowerToysSetup/RegistryPreview.wxs deleted file mode 100644 index f7bd3948d4..0000000000 --- a/installer/PowerToysSetup/RegistryPreview.wxs +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Resources.wxs b/installer/PowerToysSetup/Resources.wxs deleted file mode 100644 index b238799dd1..0000000000 --- a/installer/PowerToysSetup/Resources.wxs +++ /dev/null @@ -1,564 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Run.wxs b/installer/PowerToysSetup/Run.wxs deleted file mode 100644 index 94a589585f..0000000000 --- a/installer/PowerToysSetup/Run.wxs +++ /dev/null @@ -1,448 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Settings.wxs b/installer/PowerToysSetup/Settings.wxs deleted file mode 100644 index 07a2b056dc..0000000000 --- a/installer/PowerToysSetup/Settings.wxs +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/ShortcutGuide.wxs b/installer/PowerToysSetup/ShortcutGuide.wxs deleted file mode 100644 index 729a805861..0000000000 --- a/installer/PowerToysSetup/ShortcutGuide.wxs +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Tools.wxs b/installer/PowerToysSetup/Tools.wxs deleted file mode 100644 index 24c3fc2007..0000000000 --- a/installer/PowerToysSetup/Tools.wxs +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe b/installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe deleted file mode 100644 index d95ba2e893..0000000000 Binary files a/installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe and /dev/null differ diff --git a/installer/PowerToysSetup/WinAppSDK.wxs b/installer/PowerToysSetup/WinAppSDK.wxs deleted file mode 100644 index 631fb033ef..0000000000 --- a/installer/PowerToysSetup/WinAppSDK.wxs +++ /dev/null @@ -1,466 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/WinUI3Applications.wxs b/installer/PowerToysSetup/WinUI3Applications.wxs deleted file mode 100644 index 742f3dcf80..0000000000 --- a/installer/PowerToysSetup/WinUI3Applications.wxs +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Workspaces.wxs b/installer/PowerToysSetup/Workspaces.wxs deleted file mode 100644 index 4237aab945..0000000000 --- a/installer/PowerToysSetup/Workspaces.wxs +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/generateAllFileComponents.ps1 b/installer/PowerToysSetup/generateAllFileComponents.ps1 deleted file mode 100644 index a8365d8649..0000000000 --- a/installer/PowerToysSetup/generateAllFileComponents.ps1 +++ /dev/null @@ -1,323 +0,0 @@ -[CmdletBinding()] -Param( - [Parameter(Mandatory = $True, Position = 1)] - [string]$platform, - [Parameter(Mandatory = $False, Position = 2)] - [string]$installscopeperuser = "false" -) - -Function Generate-FileList() { - [CmdletBinding()] - Param( - # Can be multiple files separated by ; as long as they're on the same directory - [Parameter(Mandatory = $True, Position = 1)] - [AllowEmptyString()] - [string]$fileDepsJson, - [Parameter(Mandatory = $True, Position = 2)] - [string]$fileListName, - [Parameter(Mandatory = $True, Position = 3)] - [string]$wxsFilePath, - # If there is no deps.json file, just pass path to files - [Parameter(Mandatory = $False, Position = 4)] - [string]$depsPath, - # launcher plugins are being loaded into launcher process, - # so there are some additional dependencies to skip - [Parameter(Mandatory = $False, Position = 5)] - [bool]$isLauncherPlugin - ) - - $fileWxs = Get-Content $wxsFilePath; - - $fileExclusionList = @("*.pdb", "*.lastcodeanalysissucceeded", "createdump.exe", "powertoys.exe") - - $fileInclusionList = @("*.dll", "*.exe", "*.json", "*.msix", "*.png", "*.gif", "*.ico", "*.cur", "*.svg", "index.html", "reg.js", "gitignore.js", "srt.js", "monacoSpecialLanguages.js", "customTokenThemeRules.js", "*.pri") - - $dllsToIgnore = @("System.CodeDom.dll", "WindowsBase.dll") - - if ($fileDepsJson -eq [string]::Empty) { - $fileDepsRoot = $depsPath - } else { - $multipleDepsJson = $fileDepsJson.Split(";") - - foreach ( $singleDepsJson in $multipleDepsJson ) - { - - $fileDepsRoot = (Get-ChildItem $singleDepsJson).Directory.FullName - $depsJson = Get-Content $singleDepsJson | ConvertFrom-Json - - $runtimeList = ([array]$depsJson.targets.PSObject.Properties)[-1].Value.PSObject.Properties | Where-Object { - $_.Name -match "runtimepack.*Runtime" - }; - - $runtimeList | ForEach-Object { - $_.Value.PSObject.Properties.Value | ForEach-Object { - $fileExclusionList += $_.PSObject.Properties.Name - } - } - } - } - - $fileExclusionList = $fileExclusionList | Where-Object {$_ -notin $dllsToIgnore} - - if ($isLauncherPlugin -eq $True) { - $fileInclusionList += @("*.deps.json") - $fileExclusionList += @("Ijwhost.dll", "PowerToys.Common.UI.dll", "PowerToys.GPOWrapper.dll", "PowerToys.GPOWrapperProjection.dll", "PowerToys.PowerLauncher.Telemetry.dll", "PowerToys.ManagedCommon.dll", "PowerToys.Settings.UI.Lib.dll", "Wox.Infrastructure.dll", "Wox.Plugin.dll") - } - - $fileList = Get-ChildItem $fileDepsRoot -Include $fileInclusionList -Exclude $fileExclusionList -File -Name - - $fileWxs = $fileWxs -replace "(<\?define $($fileListName)=)", "") { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'fileList', - Justification = 'variable is used in another scope')] - - $fileList = $matches[2] -split ';' - return - } - } - - $componentId = "$($fileListName)_Component" - - $componentDefs = "`r`n" - $componentDefs += - @" - - - - `r`n -"@ - - foreach ($file in $fileList) { - $fileTmp = $file -replace "-", "_" - $componentDefs += - @" - `r`n -"@ - } - - $componentDefs += - @" - `r`n -"@ - - $wxsFile = $wxsFile -replace "\s+()", $componentDefs - - $componentRef = - @" - -"@ - - $wxsFile = $wxsFile -replace "\s+()", "$componentRef`r`n " - - Set-Content -Path $wxsFilePath -Value $wxsFile -} - -if ($platform -ceq "arm64") { - $platform = "ARM64" -} - -if ($installscopeperuser -eq "true") { - $registryroot = "HKCU" -} else { - $registryroot = "HKLM" -} - -#BaseApplications -Generate-FileList -fileDepsJson "" -fileListName BaseApplicationsFiles -wxsFilePath $PSScriptRoot\BaseApplications.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release" -Generate-FileComponents -fileListName "BaseApplicationsFiles" -wxsFilePath $PSScriptRoot\BaseApplications.wxs -regroot $registryroot - -#WinUI3Applications -Generate-FileList -fileDepsJson "" -fileListName WinUI3ApplicationsFiles -wxsFilePath $PSScriptRoot\WinUI3Applications.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps" -Generate-FileComponents -fileListName "WinUI3ApplicationsFiles" -wxsFilePath $PSScriptRoot\WinUI3Applications.wxs -regroot $registryroot - -#AdvancedPaste -Generate-FileList -fileDepsJson "" -fileListName AdvancedPasteAssetsFiles -wxsFilePath $PSScriptRoot\AdvancedPaste.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\AdvancedPaste" -Generate-FileComponents -fileListName "AdvancedPasteAssetsFiles" -wxsFilePath $PSScriptRoot\AdvancedPaste.wxs -regroot $registryroot - -#AwakeFiles -Generate-FileList -fileDepsJson "" -fileListName AwakeImagesFiles -wxsFilePath $PSScriptRoot\Awake.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\Awake" -Generate-FileComponents -fileListName "AwakeImagesFiles" -wxsFilePath $PSScriptRoot\Awake.wxs -regroot $registryroot - -#ColorPicker -Generate-FileList -fileDepsJson "" -fileListName ColorPickerAssetsFiles -wxsFilePath $PSScriptRoot\ColorPicker.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\ColorPicker" -Generate-FileComponents -fileListName "ColorPickerAssetsFiles" -wxsFilePath $PSScriptRoot\ColorPicker.wxs -regroot $registryroot - -#Environment Variables -Generate-FileList -fileDepsJson "" -fileListName EnvironmentVariablesAssetsFiles -wxsFilePath $PSScriptRoot\EnvironmentVariables.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\EnvironmentVariables" -Generate-FileComponents -fileListName "EnvironmentVariablesAssetsFiles" -wxsFilePath $PSScriptRoot\EnvironmentVariables.wxs -regroot $registryroot - -#FileExplorerAdd-ons -Generate-FileList -fileDepsJson "" -fileListName MonacoPreviewHandlerMonacoAssetsFiles -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\Monaco" -Generate-FileList -fileDepsJson "" -fileListName MonacoPreviewHandlerCustomLanguagesFiles -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\Monaco\customLanguages" -Generate-FileComponents -fileListName "MonacoPreviewHandlerMonacoAssetsFiles" -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -regroot $registryroot -Generate-FileComponents -fileListName "MonacoPreviewHandlerCustomLanguagesFiles" -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -regroot $registryroot - -#FileLocksmith -Generate-FileList -fileDepsJson "" -fileListName FileLocksmithAssetsFiles -wxsFilePath $PSScriptRoot\FileLocksmith.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\FileLocksmith" -Generate-FileComponents -fileListName "FileLocksmithAssetsFiles" -wxsFilePath $PSScriptRoot\FileLocksmith.wxs -regroot $registryroot - -#Hosts -Generate-FileList -fileDepsJson "" -fileListName HostsAssetsFiles -wxsFilePath $PSScriptRoot\Hosts.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Hosts" -Generate-FileComponents -fileListName "HostsAssetsFiles" -wxsFilePath $PSScriptRoot\Hosts.wxs -regroot $registryroot - -#ImageResizer -Generate-FileList -fileDepsJson "" -fileListName ImageResizerAssetsFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\ImageResizer" -Generate-FileComponents -fileListName "ImageResizerAssetsFiles" -wxsFilePath $PSScriptRoot\ImageResizer.wxs -regroot $registryroot - -#New+ -Generate-FileList -fileDepsJson "" -fileListName NewPlusAssetsFiles -wxsFilePath $PSScriptRoot\NewPlus.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\NewPlus" -Generate-FileComponents -fileListName "NewPlusAssetsFiles" -wxsFilePath $PSScriptRoot\NewPlus.wxs -regroot $registryroot - -#Peek -Generate-FileList -fileDepsJson "" -fileListName PeekAssetsFiles -wxsFilePath $PSScriptRoot\Peek.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Peek\" -Generate-FileComponents -fileListName "PeekAssetsFiles" -wxsFilePath $PSScriptRoot\Peek.wxs -regroot $registryroot - -#PowerRename -Generate-FileList -fileDepsJson "" -fileListName PowerRenameAssetsFiles -wxsFilePath $PSScriptRoot\PowerRename.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\PowerRename\" -Generate-FileComponents -fileListName "PowerRenameAssetsFiles" -wxsFilePath $PSScriptRoot\PowerRename.wxs -regroot $registryroot - -#RegistryPreview -Generate-FileList -fileDepsJson "" -fileListName RegistryPreviewAssetsFiles -wxsFilePath $PSScriptRoot\RegistryPreview.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\RegistryPreview\" -Generate-FileComponents -fileListName "RegistryPreviewAssetsFiles" -wxsFilePath $PSScriptRoot\RegistryPreview.wxs -regroot $registryroot - -#Run -Generate-FileList -fileDepsJson "" -fileListName launcherImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\PowerLauncher" -Generate-FileComponents -fileListName "launcherImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -## Plugins -###Calculator -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Calculator\Microsoft.PowerToys.Run.Plugin.Calculator.deps.json" -fileListName calcComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName calcImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Calculator\Images" -Generate-FileComponents -fileListName "calcComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "calcImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###Folder -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Folder\Microsoft.Plugin.Folder.deps.json" -fileListName FolderComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName FolderImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Folder\Images" -Generate-FileComponents -fileListName "FolderComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "FolderImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###Program -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Program\Microsoft.Plugin.Program.deps.json" -fileListName ProgramComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName ProgramImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Program\Images" -Generate-FileComponents -fileListName "ProgramComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "ProgramImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###Shell -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Shell\Microsoft.Plugin.Shell.deps.json" -fileListName ShellComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName ShellImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Shell\Images" -Generate-FileComponents -fileListName "ShellComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "ShellImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###Indexer -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Indexer\Microsoft.Plugin.Indexer.deps.json" -fileListName IndexerComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName IndexerImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Indexer\Images" -Generate-FileComponents -fileListName "IndexerComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "IndexerImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###UnitConverter -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\UnitConverter\Community.PowerToys.Run.Plugin.UnitConverter.deps.json" -fileListName UnitConvCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName UnitConvImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\UnitConverter\Images" -Generate-FileComponents -fileListName "UnitConvCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "UnitConvImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###WebSearch -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WebSearch\Community.PowerToys.Run.Plugin.WebSearch.deps.json" -fileListName WebSrchCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName WebSrchImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WebSearch\Images" -Generate-FileComponents -fileListName "WebSrchCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "WebSrchImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###History -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\History\Microsoft.PowerToys.Run.Plugin.History.deps.json" -fileListName HistoryPluginComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName HistoryPluginImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\History\Images" -Generate-FileComponents -fileListName "HistoryPluginComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "HistoryPluginImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###Uri -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Uri\Microsoft.Plugin.Uri.deps.json" -fileListName UriComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName UriImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Uri\Images" -Generate-FileComponents -fileListName "UriComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "UriImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###VSCodeWorkspaces -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\VSCodeWorkspaces\Community.PowerToys.Run.Plugin.VSCodeWorkspaces.deps.json" -fileListName VSCWrkCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName VSCWrkImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\VSCodeWorkspaces\Images" -Generate-FileComponents -fileListName "VSCWrkCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "VSCWrkImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###WindowWalker -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowWalker\Microsoft.Plugin.WindowWalker.deps.json" -fileListName WindowWlkrCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName WindowWlkrImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowWalker\Images" -Generate-FileComponents -fileListName "WindowWlkrCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "WindowWlkrImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###OneNote -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\OneNote\Microsoft.PowerToys.Run.Plugin.OneNote.deps.json" -fileListName OneNoteComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName OneNoteImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\OneNote\Images" -Generate-FileComponents -fileListName "OneNoteComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "OneNoteImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###Registry -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Registry\Microsoft.PowerToys.Run.Plugin.Registry.deps.json" -fileListName RegistryComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName RegistryImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Registry\Images" -Generate-FileComponents -fileListName "RegistryComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "RegistryImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###Service -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Service\Microsoft.PowerToys.Run.Plugin.Service.deps.json" -fileListName ServiceComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName ServiceImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Service\Images" -Generate-FileComponents -fileListName "ServiceComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "ServiceImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###System -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\System\Microsoft.PowerToys.Run.Plugin.System.deps.json" -fileListName SystemComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName SystemImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\System\Images" -Generate-FileComponents -fileListName "SystemComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "SystemImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###TimeDate -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\TimeDate\Microsoft.PowerToys.Run.Plugin.TimeDate.deps.json" -fileListName TimeDateComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName TimeDateImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\TimeDate\Images" -Generate-FileComponents -fileListName "TimeDateComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "TimeDateImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###WindowsSettings -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowsSettings\Microsoft.PowerToys.Run.Plugin.WindowsSettings.deps.json" -fileListName WinSetCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName WinSetImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowsSettings\Images" -Generate-FileComponents -fileListName "WinSetCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "WinSetImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###WindowsTerminal -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowsTerminal\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.deps.json" -fileListName WinTermCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName WinTermImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowsTerminal\Images" -Generate-FileComponents -fileListName "WinTermCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "WinTermImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###PowerToys -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\PowerToys\Microsoft.PowerToys.Run.Plugin.PowerToys.deps.json" -fileListName PowerToysCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName PowerToysImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\PowerToys\Images" -Generate-FileComponents -fileListName "PowerToysCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "PowerToysImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -###ValueGenerator -Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\ValueGenerator\Community.PowerToys.Run.Plugin.ValueGenerator.deps.json" -fileListName ValueGeneratorCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1 -Generate-FileList -fileDepsJson "" -fileListName ValueGeneratorImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\ValueGenerator\Images" -Generate-FileComponents -fileListName "ValueGeneratorCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -Generate-FileComponents -fileListName "ValueGeneratorImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot -## Plugins - -#ShortcutGuide -Generate-FileList -fileDepsJson "" -fileListName ShortcutGuideSvgFiles -wxsFilePath $PSScriptRoot\ShortcutGuide.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\ShortcutGuide\" -Generate-FileComponents -fileListName "ShortcutGuideSvgFiles" -wxsFilePath $PSScriptRoot\ShortcutGuide.wxs -regroot $registryroot - -#Settings -Generate-FileList -fileDepsJson "" -fileListName SettingsV2AssetsFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Settings\" -Generate-FileList -fileDepsJson "" -fileListName SettingsV2AssetsModulesFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Settings\Modules\" -Generate-FileList -fileDepsJson "" -fileListName SettingsV2OOBEAssetsModulesFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Settings\Modules\OOBE\" -Generate-FileList -fileDepsJson "" -fileListName SettingsV2OOBEAssetsFluentIconsFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Settings\Icons\" -Generate-FileComponents -fileListName "SettingsV2AssetsFiles" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot -Generate-FileComponents -fileListName "SettingsV2AssetsModulesFiles" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot -Generate-FileComponents -fileListName "SettingsV2OOBEAssetsModulesFiles" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot -Generate-FileComponents -fileListName "SettingsV2OOBEAssetsFluentIconsFiles" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot - -#Workspaces -Generate-FileList -fileDepsJson "" -fileListName WorkspacesImagesComponentFiles -wxsFilePath $PSScriptRoot\Workspaces.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\Workspaces\" -Generate-FileComponents -fileListName "WorkspacesImagesComponentFiles" -wxsFilePath $PSScriptRoot\Workspaces.wxs -regroot $registryroot diff --git a/installer/PowerToysSetup/generateMonacoWxs.ps1 b/installer/PowerToysSetup/generateMonacoWxs.ps1 deleted file mode 100644 index 94536618da..0000000000 --- a/installer/PowerToysSetup/generateMonacoWxs.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -[CmdletBinding()] -Param( - [Parameter(Mandatory = $True, Position = 1)] - [string]$monacoWxsFile -) - -$fileWxs = Get-Content $monacoWxsFile; - -$fileWxs = $fileWxs -replace " KeyPath=`"yes`" ", " " - -$newFileContent = "" - -$componentId = "error" -$directories = @() - -$fileWxs | ForEach-Object { - $line = $_; - if ($line -match "") { - $line += -@" -`r`n - `r`n -"@ - } - if ($line -match "") { - $directories += $matches[1] - } - if ($line -match "") { - $line = -@" - - - - -"@ - } - - $newFileContent += $line + "`r`n"; -} - -$removeFolderEntries = -@" -`r`n - - - `r`n -"@ - -$directories | ForEach-Object { - - $removeFolderEntries += -@" - - -"@ -} - -$removeFolderEntries += -@" - -"@ - - - -$newFileContent = $newFileContent -replace "\s+()", "$removeFolderEntries`r`n " - -Set-Content -Path $monacoWxsFile -Value $newFileContent \ No newline at end of file diff --git a/installer/PowerToysSetup/packages.config b/installer/PowerToysSetup/packages.config deleted file mode 100644 index 569e1bea86..0000000000 --- a/installer/PowerToysSetup/packages.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/installer/PowerToysSetup/publish.cmd b/installer/PowerToysSetup/publish.cmd deleted file mode 100644 index f61668cffe..0000000000 --- a/installer/PowerToysSetup/publish.cmd +++ /dev/null @@ -1,17 +0,0 @@ -setlocal enableDelayedExpansion - -IF NOT DEFINED PTRoot (SET PTRoot=..\..) - -SET PlatformArg=%1 -IF NOT DEFINED PlatformArg (SET PlatformArg=x64) -SET VCToolsVersion=!VCToolsVersion! -SET ClearDevCommandPromptEnvVars=false - -rem In case of Release we should not use Debug CRT in VCRT forwarders -msbuild !PTRoot!\src\modules\previewpane\MonacoPreviewHandler\MonacoPreviewHandler.csproj -t:Publish -p:Configuration="Release" -p:Platform="!PlatformArg!" -p:AppxBundle=Never -p:PowerToysRoot=!PTRoot! -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=InstallationPublishProfile.pubxml -p:TargetFramework=net9.0-windows10.0.26100.0 - -msbuild !PTRoot!\src\modules\previewpane\MarkdownPreviewHandler\MarkdownPreviewHandler.csproj -t:Publish -p:Configuration="Release" -p:Platform="!PlatformArg!" -p:AppxBundle=Never -p:PowerToysRoot=!PTRoot! -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=InstallationPublishProfile.pubxml -p:TargetFramework=net9.0-windows10.0.26100.0 - -msbuild !PTRoot!\src\modules\previewpane\SvgPreviewHandler\SvgPreviewHandler.csproj -t:Publish -p:Configuration="Release" -p:Platform="!PlatformArg!" -p:AppxBundle=Never -p:PowerToysRoot=!PTRoot! -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=InstallationPublishProfile.pubxml -p:TargetFramework=net9.0-windows10.0.26100.0 - -msbuild !PTRoot!\src\modules\previewpane\SvgThumbnailProvider\SvgThumbnailProvider.csproj -t:Publish -p:Configuration="Release" -p:Platform="!PlatformArg!" -p:AppxBundle=Never -p:PowerToysRoot=!PTRoot! -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=InstallationPublishProfile.pubxml -p:TargetFramework=net9.0-windows10.0.26100.0 \ No newline at end of file diff --git a/installer/PowerToysSetup/terminate_powertoys.cmd b/installer/PowerToysSetup/terminate_powertoys.cmd deleted file mode 100644 index 8206b90aae..0000000000 --- a/installer/PowerToysSetup/terminate_powertoys.cmd +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -setlocal ENABLEDELAYEDEXPANSION - -@REM We loop here until taskkill cannot find a PowerToys process. We can't use /F flag, because it -@REM doesn't give application an opportunity to cleanup. Thus we send WM_CLOSE which is being caught -@REM by multiple windows running a msg loop in PowerToys.exe process, which we close one by one. -for /l %%x in (1, 1, 100) do ( - taskkill /IM PowerToys.exe 1>NUL 2>NUL - if !ERRORLEVEL! NEQ 0 goto quit -) - -:quit \ No newline at end of file diff --git a/installer/PowerToysSetupCustomActions/CustomAction.cpp b/installer/PowerToysSetupCustomActions/CustomAction.cpp deleted file mode 100644 index 74304c4163..0000000000 --- a/installer/PowerToysSetupCustomActions/CustomAction.cpp +++ /dev/null @@ -1,1410 +0,0 @@ -#include "pch.h" -#include "resource.h" -#include "RcResource.h" -#include -#include - -#include "../../src/common/logger/logger.h" -#include "../../src/common/utils/gpo.h" -#include "../../src/common/utils/MsiUtils.h" -#include "../../src/common/utils/modulesRegistry.h" -#include "../../src/common/updating/installer.h" -#include "../../src/common/version/version.h" -#include "../../src/common/Telemetry/EtwTrace/EtwTrace.h" -#include "../../src/common/utils/package.h" -#include "../../src/common/utils/clean_video_conference.h" - -#include -#include -#include -#include - -#include -#include -#include -#include - -using namespace std; - -HINSTANCE DLL_HANDLE = nullptr; - -TRACELOGGING_DEFINE_PROVIDER( - g_hProvider, - "Microsoft.PowerToys", - // {38e8889b-9731-53f5-e901-e8a7c1753074} - (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), - TraceLoggingOptionProjectTelemetry()); - -const DWORD USERNAME_DOMAIN_LEN = DNLEN + UNLEN + 2; // Domain Name + '\' + User Name + '\0' -const DWORD USERNAME_LEN = UNLEN + 1; // User Name + '\0' - -static const wchar_t *POWERTOYS_EXE_COMPONENT = L"{A2C66D91-3485-4D00-B04D-91844E6B345B}"; -static const wchar_t *POWERTOYS_UPGRADE_CODE = L"{42B84BF7-5FBF-473B-9C8B-049DC16F7708}"; - -constexpr inline const wchar_t *DataDiagnosticsRegKey = L"Software\\Classes\\PowerToys"; -constexpr inline const wchar_t *DataDiagnosticsRegValueName = L"AllowDataDiagnostics"; - -#define TraceLoggingWriteWrapper(provider, eventName, ...) \ - if (isDataDiagnosticEnabled()) \ - { \ - trace.UpdateState(true); \ - TraceLoggingWrite(provider, eventName, __VA_ARGS__); \ - trace.Flush(); \ - trace.UpdateState(false); \ - } - -static Shared::Trace::ETWTrace trace{L"PowerToys_Installer"}; - -inline bool isDataDiagnosticEnabled() -{ - HKEY key{}; - if (RegOpenKeyExW(HKEY_CURRENT_USER, - DataDiagnosticsRegKey, - 0, - KEY_READ, - &key) != ERROR_SUCCESS) - { - return false; - } - - DWORD isDataDiagnosticsEnabled = 0; - DWORD size = sizeof(isDataDiagnosticsEnabled); - - if (RegGetValueW( - HKEY_CURRENT_USER, - DataDiagnosticsRegKey, - DataDiagnosticsRegValueName, - RRF_RT_REG_DWORD, - nullptr, - &isDataDiagnosticsEnabled, - &size) != ERROR_SUCCESS) - { - RegCloseKey(key); - return false; - } - RegCloseKey(key); - - return isDataDiagnosticsEnabled == 1; -} - -HRESULT getInstallFolder(MSIHANDLE hInstall, std::wstring &installationDir) -{ - DWORD len = 0; - wchar_t _[1]; - MsiGetPropertyW(hInstall, L"CustomActionData", _, &len); - len += 1; - installationDir.resize(len); - HRESULT hr = MsiGetPropertyW(hInstall, L"CustomActionData", installationDir.data(), &len); - if (installationDir.length()) - { - installationDir.resize(installationDir.length() - 1); - } - ExitOnFailure(hr, "Failed to get INSTALLFOLDER property."); -LExit: - return hr; -} - -BOOL IsLocalSystem() -{ - HANDLE hToken; - UCHAR bTokenUser[sizeof(TOKEN_USER) + 8 + 4 * SID_MAX_SUB_AUTHORITIES]; - PTOKEN_USER pTokenUser = (PTOKEN_USER)bTokenUser; - ULONG cbTokenUser; - SID_IDENTIFIER_AUTHORITY siaNT = SECURITY_NT_AUTHORITY; - PSID pSystemSid; - BOOL bSystem; - - // open process token - if (!OpenProcessToken(GetCurrentProcess(), - TOKEN_QUERY, - &hToken)) - return FALSE; - - // retrieve user SID - if (!GetTokenInformation(hToken, TokenUser, pTokenUser, - sizeof(bTokenUser), &cbTokenUser)) - { - CloseHandle(hToken); - return FALSE; - } - - CloseHandle(hToken); - - // allocate LocalSystem well-known SID - if (!AllocateAndInitializeSid(&siaNT, 1, SECURITY_LOCAL_SYSTEM_RID, - 0, 0, 0, 0, 0, 0, 0, &pSystemSid)) - return FALSE; - - // compare the user SID from the token with the LocalSystem SID - bSystem = EqualSid(pTokenUser->User.Sid, pSystemSid); - - FreeSid(pSystemSid); - - return bSystem; -} - -BOOL ImpersonateLoggedInUserAndDoSomething(std::function action) -{ - HRESULT hr = S_OK; - HANDLE hUserToken = NULL; - DWORD dwSessionId; - ProcessIdToSessionId(GetCurrentProcessId(), &dwSessionId); - auto rv = WTSQueryUserToken(dwSessionId, &hUserToken); - - if (rv == 0) - { - hr = E_ABORT; - ExitOnFailure(hr, "Failed to query user token"); - } - - HANDLE hUserTokenDup; - if (DuplicateTokenEx(hUserToken, TOKEN_ALL_ACCESS, NULL, SECURITY_IMPERSONATION_LEVEL::SecurityImpersonation, TOKEN_TYPE::TokenPrimary, &hUserTokenDup) == 0) - { - CloseHandle(hUserToken); - CloseHandle(hUserTokenDup); - hr = E_ABORT; - ExitOnFailure(hr, "Failed to duplicate user token"); - } - - if (ImpersonateLoggedOnUser(hUserTokenDup)) - { - if (!action(hUserTokenDup)) - { - hr = E_ABORT; - ExitOnFailure(hr, "Failed to execute action"); - } - - RevertToSelf(); - CloseHandle(hUserToken); - CloseHandle(hUserTokenDup); - } - else - { - hr = E_ABORT; - ExitOnFailure(hr, "Failed to duplicate user token"); - } - -LExit: - return SUCCEEDED(hr); -} - -static std::filesystem::path GetUserPowerShellModulesPath() -{ - PWSTR myDocumentsBlockPtr; - - if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Documents, 0, NULL, &myDocumentsBlockPtr))) - { - const std::wstring myDocuments{myDocumentsBlockPtr}; - CoTaskMemFree(myDocumentsBlockPtr); - return std::filesystem::path(myDocuments) / "PowerShell" / "Modules"; - } - else - { - CoTaskMemFree(myDocumentsBlockPtr); - return {}; - } -} - -UINT __stdcall LaunchPowerToysCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - std::wstring installationFolder, path, args; - std::wstring commandLine; - - hr = WcaInitialize(hInstall, "LaunchPowerToys"); - ExitOnFailure(hr, "Failed to initialize"); - hr = getInstallFolder(hInstall, installationFolder); - ExitOnFailure(hr, "Failed to get installFolder."); - - path = installationFolder; - path += L"\\PowerToys.exe"; - - args = L"--dont-elevate"; - - commandLine = L"\"" + path + L"\" "; - commandLine += args; - - BOOL isSystemUser = IsLocalSystem(); - - if (isSystemUser) - { - - auto action = [&commandLine](HANDLE userToken) - { - STARTUPINFO startupInfo{.cb = sizeof(STARTUPINFO), .wShowWindow = SW_SHOWNORMAL}; - PROCESS_INFORMATION processInformation; - - PVOID lpEnvironment = NULL; - CreateEnvironmentBlock(&lpEnvironment, userToken, FALSE); - - CreateProcessAsUser( - userToken, - NULL, - commandLine.data(), - NULL, - NULL, - FALSE, - CREATE_DEFAULT_ERROR_MODE | CREATE_UNICODE_ENVIRONMENT, - lpEnvironment, - NULL, - &startupInfo, - &processInformation); - - if (!CloseHandle(processInformation.hProcess)) - { - return false; - } - if (!CloseHandle(processInformation.hThread)) - { - return false; - } - - return true; - }; - - if (!ImpersonateLoggedInUserAndDoSomething(action)) - { - hr = E_ABORT; - ExitOnFailure(hr, "ImpersonateLoggedInUserAndDoSomething failed"); - } - } - else - { - STARTUPINFO startupInfo{.cb = sizeof(STARTUPINFO), .wShowWindow = SW_SHOWNORMAL}; - - PROCESS_INFORMATION processInformation; - - // Start the resizer - CreateProcess( - NULL, - commandLine.data(), - NULL, - NULL, - TRUE, - 0, - NULL, - NULL, - &startupInfo, - &processInformation); - - if (!CloseHandle(processInformation.hProcess)) - { - hr = E_ABORT; - ExitOnFailure(hr, "Failed to close process handle"); - } - if (!CloseHandle(processInformation.hThread)) - { - hr = E_ABORT; - ExitOnFailure(hr, "Failed to close thread handle"); - } - } - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall CheckGPOCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - - hr = WcaInitialize(hInstall, "CheckGPOCA"); - ExitOnFailure(hr, "Failed to initialize"); - - LPWSTR currentScope = nullptr; - hr = WcaGetProperty(L"InstallScope", ¤tScope); - - if (std::wstring{currentScope} == L"perUser") - { - if (powertoys_gpo::getDisablePerUserInstallationValue() == powertoys_gpo::gpo_rule_configured_enabled) - { - PMSIHANDLE hRecord = MsiCreateRecord(0); - MsiRecordSetString(hRecord, 0, TEXT("The system administrator has disabled per-user installation.")); - MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_ERROR + MB_OK), hRecord); - hr = E_ABORT; - } - } - -LExit: - UINT er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -// We've deprecated Video Conference Mute. This Custom Action cleans up any stray registry entry for the driver dll. -UINT __stdcall CleanVideoConferenceRegistryCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - hr = WcaInitialize(hInstall, "CleanVideoConferenceRegistry"); - ExitOnFailure(hr, "Failed to initialize"); - clean_video_conference(); -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall ApplyModulesRegistryChangeSetsCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - std::wstring installationFolder; - bool failedToApply = false; - - hr = WcaInitialize(hInstall, "ApplyModulesRegistryChangeSets"); - ExitOnFailure(hr, "Failed to initialize"); - hr = getInstallFolder(hInstall, installationFolder); - ExitOnFailure(hr, "Failed to get installFolder."); - - for (const auto &changeSet : getAllOnByDefaultModulesChangeSets(installationFolder)) - { - if (!changeSet.apply()) - { - Logger::error(L"Couldn't apply registry changeSet"); - failedToApply = true; - } - } - - if (!failedToApply) - { - Logger::info(L"All registry changeSets applied successfully"); - } -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall UnApplyModulesRegistryChangeSetsCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - std::wstring installationFolder; - - hr = WcaInitialize(hInstall, "UndoModulesRegistryChangeSets"); // original func name is too long - ExitOnFailure(hr, "Failed to initialize"); - hr = getInstallFolder(hInstall, installationFolder); - ExitOnFailure(hr, "Failed to get installFolder."); - for (const auto &changeSet : getAllModulesChangeSets(installationFolder)) - { - changeSet.unApply(); - } - - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); - - ExitOnFailure(hr, "Failed to extract msix"); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -const wchar_t *DSC_CONFIGURE_PSD1_NAME = L"Microsoft.PowerToys.Configure.psd1"; -const wchar_t *DSC_CONFIGURE_PSM1_NAME = L"Microsoft.PowerToys.Configure.psm1"; - -UINT __stdcall InstallDSCModuleCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - std::wstring installationFolder; - - hr = WcaInitialize(hInstall, "InstallDSCModuleCA"); - ExitOnFailure(hr, "Failed to initialize"); - - hr = getInstallFolder(hInstall, installationFolder); - ExitOnFailure(hr, "Failed to get installFolder."); - - { - const auto baseModulesPath = GetUserPowerShellModulesPath(); - if (baseModulesPath.empty()) - { - hr = E_FAIL; - ExitOnFailure(hr, "Unable to determine Powershell modules path"); - } - - const auto modulesPath = baseModulesPath / L"Microsoft.PowerToys.Configure" / (get_product_version(false) + L".0"); - - std::error_code errorCode; - fs::create_directories(modulesPath, errorCode); - if (errorCode) - { - hr = E_FAIL; - ExitOnFailure(hr, "Unable to create Powershell modules folder"); - } - - for (const auto *filename : {DSC_CONFIGURE_PSD1_NAME, DSC_CONFIGURE_PSM1_NAME}) - { - fs::copy_file(fs::path(installationFolder) / "DSCModules" / filename, modulesPath / filename, fs::copy_options::overwrite_existing, errorCode); - - if (errorCode) - { - hr = E_FAIL; - ExitOnFailure(hr, "Unable to copy Powershell modules file"); - } - } - } - -LExit: - if (SUCCEEDED(hr)) - { - er = ERROR_SUCCESS; - Logger::info(L"DSC module was installed!"); - } - else - { - er = ERROR_INSTALL_FAILURE; - Logger::error(L"Couldn't install DSC module!"); - } - - return WcaFinalize(er); -} - -UINT __stdcall UninstallDSCModuleCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "UninstallDSCModuleCA"); - ExitOnFailure(hr, "Failed to initialize"); - - { - const auto baseModulesPath = GetUserPowerShellModulesPath(); - if (baseModulesPath.empty()) - { - hr = E_FAIL; - ExitOnFailure(hr, "Unable to determine Powershell modules path"); - } - - const auto powerToysModulePath = baseModulesPath / L"Microsoft.PowerToys.Configure"; - const auto versionedModulePath = powerToysModulePath / (get_product_version(false) + L".0"); - - std::error_code errorCode; - - for (const auto *filename : {DSC_CONFIGURE_PSD1_NAME, DSC_CONFIGURE_PSM1_NAME}) - { - fs::remove(versionedModulePath / filename, errorCode); - - if (errorCode) - { - hr = E_FAIL; - ExitOnFailure(hr, "Unable to delete DSC file"); - } - } - - for (const auto *modulePath : {&versionedModulePath, &powerToysModulePath}) - { - fs::remove(*modulePath, errorCode); - - if (errorCode) - { - hr = E_FAIL; - ExitOnFailure(hr, "Unable to delete DSC folder"); - } - } - } - -LExit: - if (SUCCEEDED(hr)) - { - er = ERROR_SUCCESS; - Logger::info(L"DSC module was uninstalled!"); - } - else - { - er = ERROR_INSTALL_FAILURE; - Logger::error(L"Couldn't uninstall DSC module!"); - } - - return WcaFinalize(er); -} - -UINT __stdcall InstallEmbeddedMSIXCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - hr = WcaInitialize(hInstall, "InstallEmbeddedMSIXCA"); - ExitOnFailure(hr, "Failed to initialize"); - - if (auto msix = RcResource::create(IDR_BIN_MSIX_HELLO_PACKAGE, L"BIN", DLL_HANDLE)) - { - Logger::info(L"Extracted MSIX"); - // TODO: Use to activate embedded MSIX - const auto msix_path = std::filesystem::temp_directory_path() / "hello_package.msix"; - if (!msix->saveAsFile(msix_path)) - { - ExitOnFailure(hr, "Failed to save msix"); - } - Logger::info(L"Saved MSIX"); - using namespace winrt::Windows::Management::Deployment; - using namespace winrt::Windows::Foundation; - - Uri msix_uri{msix_path.wstring()}; - PackageManager pm; - auto result = pm.AddPackageAsync(msix_uri, nullptr, DeploymentOptions::None).get(); - if (!result) - { - ExitOnFailure(hr, "Failed to AddPackage"); - } - - Logger::info(L"MSIX[s] were installed!"); - } - else - { - ExitOnFailure(hr, "Failed to extract msix"); - } - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall UninstallEmbeddedMSIXCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - using namespace winrt::Windows::Management::Deployment; - using namespace winrt::Windows::Foundation; - // TODO: This must be replaced with the actual publisher and package name - const wchar_t package_name[] = L"46b35c25-b593-48d5-aeb1-d3e9c3b796e9"; - const wchar_t publisher[] = L"CN=yuyoyuppe"; - PackageManager pm; - - hr = WcaInitialize(hInstall, "UninstallEmbeddedMSIXCA"); - ExitOnFailure(hr, "Failed to initialize"); - - for (const auto &p : pm.FindPackagesForUser({}, package_name, publisher)) - { - auto result = pm.RemovePackageAsync(p.Id().FullName()).get(); - if (result) - { - Logger::info(L"MSIX was uninstalled!"); - } - else - { - Logger::error(L"Couldn't uninstall MSIX!"); - } - } - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall RemoveWindowsServiceByName(std::wstring serviceName) -{ - SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); - - if (!hSCManager) - { - return ERROR_INSTALL_FAILURE; - } - - SC_HANDLE hService = OpenService(hSCManager, serviceName.c_str(), SERVICE_STOP | DELETE); - if (!hService) - { - CloseServiceHandle(hSCManager); - return ERROR_INSTALL_FAILURE; - } - - SERVICE_STATUS ss; - if (ControlService(hService, SERVICE_CONTROL_STOP, &ss)) - { - Sleep(1000); - while (QueryServiceStatus(hService, &ss)) - { - if (ss.dwCurrentState == SERVICE_STOP_PENDING) - { - Sleep(1000); - } - else - { - break; - } - } - } - - BOOL deleteResult = DeleteService(hService); - CloseServiceHandle(hService); - CloseServiceHandle(hSCManager); - - if (!deleteResult) - { - return ERROR_INSTALL_FAILURE; - } - - return ERROR_SUCCESS; -} - -UINT __stdcall UnsetAdvancedPasteAPIKeyCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - try - { - winrt::Windows::Security::Credentials::PasswordVault vault; - winrt::Windows::Security::Credentials::PasswordCredential cred; - - hr = WcaInitialize(hInstall, "UnsetAdvancedPasteAPIKey"); - ExitOnFailure(hr, "Failed to initialize"); - - cred = vault.Retrieve(L"https://platform.openai.com/api-keys", L"PowerToys_AdvancedPaste_OpenAIKey"); - vault.Remove(cred); - } - catch (...) - { - } - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall UninstallCommandNotFoundModuleCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - std::wstring installationFolder; - std::string command; - - hr = WcaInitialize(hInstall, "UninstallCommandNotFoundModule"); - ExitOnFailure(hr, "Failed to initialize"); - - hr = getInstallFolder(hInstall, installationFolder); - ExitOnFailure(hr, "Failed to get installFolder."); - -#ifdef _M_ARM64 - command = "powershell.exe"; - command += " "; - command += "-NoProfile -NonInteractive -NoLogo -WindowStyle Hidden -ExecutionPolicy Unrestricted"; - command += " -Command "; - command += "\"[Environment]::SetEnvironmentVariable('PATH', [Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' + [Environment]::GetEnvironmentVariable('PATH', 'User'), 'Process');"; - command += "pwsh.exe -NoProfile -NonInteractive -NoLogo -WindowStyle Hidden -ExecutionPolicy Unrestricted -File '" + winrt::to_string(installationFolder) + "\\WinUI3Apps\\Assets\\Settings\\Scripts\\DisableModule.ps1" + "'\""; -#else - command = "pwsh.exe"; - command += " "; - command += "-NoProfile -NonInteractive -NoLogo -WindowStyle Hidden -ExecutionPolicy Unrestricted -File \"" + winrt::to_string(installationFolder) + "\\WinUI3Apps\\Assets\\Settings\\Scripts\\DisableModule.ps1" + "\""; -#endif - - system(command.c_str()); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall UpgradeCommandNotFoundModuleCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - std::wstring installationFolder; - std::string command; - - hr = WcaInitialize(hInstall, "UpgradeCommandNotFoundModule"); - ExitOnFailure(hr, "Failed to initialize"); - - hr = getInstallFolder(hInstall, installationFolder); - ExitOnFailure(hr, "Failed to get installFolder."); - - command = "pwsh.exe"; - command += " "; - command += "-NoProfile -NonInteractive -NoLogo -WindowStyle Hidden -ExecutionPolicy Unrestricted -File \"" + winrt::to_string(installationFolder) + "\\WinUI3Apps\\Assets\\Settings\\Scripts\\UpgradeModule.ps1" + "\""; - - system(command.c_str()); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall UninstallServicesCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - hr = WcaInitialize(hInstall, "UninstallServicesCA"); - - ExitOnFailure(hr, "Failed to initialize"); - - hr = RemoveWindowsServiceByName(L"PowerToys.MWB.Service"); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -// Removes all Scheduled Tasks in the PowerToys folder and deletes the folder afterwards. -// Based on the Task Scheduler Displaying Task Names and State example: -// https://learn.microsoft.com/windows/desktop/TaskSchd/displaying-task-names-and-state--c---/ -UINT __stdcall RemoveScheduledTasksCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - ITaskService *pService = nullptr; - ITaskFolder *pTaskFolder = nullptr; - IRegisteredTaskCollection *pTaskCollection = nullptr; - ITaskFolder *pRootFolder = nullptr; - LONG numTasks = 0; - - hr = WcaInitialize(hInstall, "RemoveScheduledTasksCA"); - ExitOnFailure(hr, "Failed to initialize"); - - Logger::info(L"RemoveScheduledTasksCA Initialized."); - - // COM and Security Initialization is expected to have been done by the MSI. - // It couldn't be done in the DLL, anyway. - // ------------------------------------------------------ - // Create an instance of the Task Service. - hr = CoCreateInstance(CLSID_TaskScheduler, - nullptr, - CLSCTX_INPROC_SERVER, - IID_ITaskService, - reinterpret_cast(&pService)); - ExitOnFailure(hr, "Failed to create an instance of ITaskService: %x", hr); - - // Connect to the task service. - hr = pService->Connect(_variant_t(), _variant_t(), _variant_t(), _variant_t()); - ExitOnFailure(hr, "ITaskService::Connect failed: %x", hr); - - // ------------------------------------------------------ - // Get the PowerToys task folder. - hr = pService->GetFolder(_bstr_t(L"\\PowerToys"), &pTaskFolder); - if (FAILED(hr)) - { - // Folder doesn't exist. No need to delete anything. - Logger::info(L"The PowerToys scheduled task folder wasn't found. Nothing to delete."); - hr = S_OK; - ExitFunction(); - } - - // ------------------------------------------------------- - // Get the registered tasks in the folder. - hr = pTaskFolder->GetTasks(TASK_ENUM_HIDDEN, &pTaskCollection); - ExitOnFailure(hr, "Cannot get the registered tasks: %x", hr); - - hr = pTaskCollection->get_Count(&numTasks); - for (LONG i = 0; i < numTasks; i++) - { - // Delete all the tasks found. - // If some tasks can't be deleted, the folder won't be deleted later and the user will still be notified. - IRegisteredTask *pRegisteredTask = nullptr; - hr = pTaskCollection->get_Item(_variant_t(i + 1), &pRegisteredTask); - if (SUCCEEDED(hr)) - { - BSTR taskName = nullptr; - hr = pRegisteredTask->get_Name(&taskName); - if (SUCCEEDED(hr)) - { - hr = pTaskFolder->DeleteTask(taskName, 0); - if (FAILED(hr)) - { - Logger::error(L"Cannot delete the {} task: {}", taskName, hr); - } - SysFreeString(taskName); - } - else - { - Logger::error(L"Cannot get the registered task name: {}", hr); - } - pRegisteredTask->Release(); - } - else - { - Logger::error(L"Cannot get the registered task item at index={}: {}", i + 1, hr); - } - } - - // ------------------------------------------------------ - // Get the pointer to the root task folder and delete the PowerToys subfolder. - hr = pService->GetFolder(_bstr_t(L"\\"), &pRootFolder); - ExitOnFailure(hr, "Cannot get Root Folder pointer: %x", hr); - hr = pRootFolder->DeleteFolder(_bstr_t(L"PowerToys"), 0); - pRootFolder->Release(); - ExitOnFailure(hr, "Cannot delete the PowerToys folder: %x", hr); - - Logger::info(L"Deleted the PowerToys Task Scheduler folder."); - -LExit: - if (pService) - { - pService->Release(); - } - if (pTaskFolder) - { - pTaskFolder->Release(); - } - if (pTaskCollection) - { - pTaskCollection->Release(); - } - - if (!SUCCEEDED(hr)) - { - PMSIHANDLE hRecord = MsiCreateRecord(0); - MsiRecordSetString(hRecord, 0, TEXT("Failed to remove the PowerToys folder from the scheduled task. These can be removed manually later.")); - MsiProcessMessage(hInstall, static_cast(INSTALLMESSAGE_WARNING + MB_OK), hRecord); - } - - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall TelemetryLogInstallSuccessCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "TelemetryLogInstallSuccessCA"); - ExitOnFailure(hr, "Failed to initialize"); - - TraceLoggingWriteWrapper( - g_hProvider, - "Install_Success", - TraceLoggingWideString(get_product_version().c_str(), "Version"), - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall TelemetryLogInstallCancelCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "TelemetryLogInstallCancelCA"); - ExitOnFailure(hr, "Failed to initialize"); - - TraceLoggingWriteWrapper( - g_hProvider, - "Install_Cancel", - TraceLoggingWideString(get_product_version().c_str(), "Version"), - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall TelemetryLogInstallFailCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "TelemetryLogInstallFailCA"); - ExitOnFailure(hr, "Failed to initialize"); - - TraceLoggingWriteWrapper( - g_hProvider, - "Install_Fail", - TraceLoggingWideString(get_product_version().c_str(), "Version"), - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall TelemetryLogUninstallSuccessCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "TelemetryLogUninstallSuccessCA"); - ExitOnFailure(hr, "Failed to initialize"); - - TraceLoggingWriteWrapper( - g_hProvider, - "UnInstall_Success", - TraceLoggingWideString(get_product_version().c_str(), "Version"), - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall TelemetryLogUninstallCancelCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "TelemetryLogUninstallCancelCA"); - ExitOnFailure(hr, "Failed to initialize"); - - TraceLoggingWriteWrapper( - g_hProvider, - "UnInstall_Cancel", - TraceLoggingWideString(get_product_version().c_str(), "Version"), - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall TelemetryLogUninstallFailCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "TelemetryLogUninstallFailCA"); - ExitOnFailure(hr, "Failed to initialize"); - - TraceLoggingWriteWrapper( - g_hProvider, - "UnInstall_Fail", - TraceLoggingWideString(get_product_version().c_str(), "Version"), - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall TelemetryLogRepairCancelCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "TelemetryLogRepairCancelCA"); - ExitOnFailure(hr, "Failed to initialize"); - - TraceLoggingWriteWrapper( - g_hProvider, - "Repair_Cancel", - TraceLoggingWideString(get_product_version().c_str(), "Version"), - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall TelemetryLogRepairFailCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "TelemetryLogRepairFailCA"); - ExitOnFailure(hr, "Failed to initialize"); - - TraceLoggingWriteWrapper( - g_hProvider, - "Repair_Fail", - TraceLoggingWideString(get_product_version().c_str(), "Version"), - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall DetectPrevInstallPathCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - hr = WcaInitialize(hInstall, "DetectPrevInstallPathCA"); - MsiSetPropertyW(hInstall, L"PREVIOUSINSTALLFOLDER", L""); - - LPWSTR currentScope = nullptr; - hr = WcaGetProperty(L"InstallScope", ¤tScope); - - try - { - if (auto install_path = GetMsiPackageInstalledPath(std::wstring{currentScope} == L"perUser")) - { - MsiSetPropertyW(hInstall, L"PREVIOUSINSTALLFOLDER", install_path->data()); - } - } - catch (...) - { - } - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -UINT __stdcall InstallCmdPalPackageCA(MSIHANDLE hInstall) -{ - using namespace winrt::Windows::Foundation; - using namespace winrt::Windows::Management::Deployment; - - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - std::wstring installationFolder; - - hr = WcaInitialize(hInstall, "InstallCmdPalPackage"); - hr = getInstallFolder(hInstall, installationFolder); - - try - { - auto msix = package::FindMsixFile(installationFolder + L"\\WinUI3Apps\\CmdPal\\", false); - auto dependencies = package::FindMsixFile(installationFolder + L"\\WinUI3Apps\\CmdPal\\Dependencies\\", true); - - if (!msix.empty()) - { - auto msixPath = msix[0]; - - if (!package::RegisterPackage(msixPath, dependencies)) - { - Logger::error(L"Failed to install CmdPal package"); - er = ERROR_INSTALL_FAILURE; - } - } - } - catch (std::exception &e) - { - std::string errorMessage{"Exception thrown while trying to install CmdPal package: "}; - errorMessage += e.what(); - Logger::error(errorMessage); - - er = ERROR_INSTALL_FAILURE; - } - - er = er == ERROR_SUCCESS ? (SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE) : er; - return WcaFinalize(er); -} - -UINT __stdcall UnRegisterCmdPalPackageCA(MSIHANDLE hInstall) -{ - using namespace winrt::Windows::Foundation; - using namespace winrt::Windows::Management::Deployment; - - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "UnRegisterCmdPalPackageCA"); - - try - { - // Packages to unregister - std::wstring packageToRemoveDisplayName {L"Microsoft.CommandPalette"}; - - if (!package::UnRegisterPackage(packageToRemoveDisplayName)) - { - Logger::error(L"Failed to unregister package: " + packageToRemoveDisplayName); - er = ERROR_INSTALL_FAILURE; - } - } - catch (std::exception &e) - { - std::string errorMessage{"Exception thrown while trying to unregister the CmdPal package: "}; - errorMessage += e.what(); - Logger::error(errorMessage); - - er = ERROR_INSTALL_FAILURE; - } - - er = er == ERROR_SUCCESS ? (SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE) : er; - return WcaFinalize(er); -} - - -UINT __stdcall UnRegisterContextMenuPackagesCA(MSIHANDLE hInstall) -{ - using namespace winrt::Windows::Foundation; - using namespace winrt::Windows::Management::Deployment; - - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "UnRegisterContextMenuPackagesCA"); // original func name is too long - - try - { - // Packages to unregister - const std::vector packagesToRemoveDisplayName{{L"PowerRenameContextMenu"}, {L"ImageResizerContextMenu"}, {L"FileLocksmithContextMenu"}, {L"NewPlusContextMenu"}}; - - for (auto const &package : packagesToRemoveDisplayName) - { - if (!package::UnRegisterPackage(package)) - { - Logger::error(L"Failed to unregister package: " + package); - er = ERROR_INSTALL_FAILURE; - } - } - } - catch (std::exception &e) - { - std::string errorMessage{"Exception thrown while trying to unregister sparse packages: "}; - errorMessage += e.what(); - Logger::error(errorMessage); - - er = ERROR_INSTALL_FAILURE; - } - - er = er == ERROR_SUCCESS ? (SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE) : er; - return WcaFinalize(er); -} - -UINT __stdcall CleanImageResizerRuntimeRegistryCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - hr = WcaInitialize(hInstall, "CleanImageResizerRuntimeRegistryCA"); - - try - { - const wchar_t* CLSID_STR = L"{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"; - const wchar_t* exts[] = { L".bmp", L".dib", L".gif", L".jfif", L".jpe", L".jpeg", L".jpg", L".jxr", L".png", L".rle", L".tif", L".tiff", L".wdp" }; - - auto deleteKeyRecursive = [](HKEY root, const std::wstring &path) { - RegDeleteTreeW(root, path.c_str()); - }; - - // InprocServer32 chain root CLSID - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\" + std::wstring(CLSID_STR)); - // DragDrop handler - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\Directory\\ShellEx\\DragDropHandlers\\ImageResizer"); - // Extensions - for (auto ext : exts) - { - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\SystemFileAssociations\\" + std::wstring(ext) + L"\\ShellEx\\ContextMenuHandlers\\ImageResizer"); - } - // Sentinel - RegDeleteTreeW(HKEY_CURRENT_USER, L"Software\\Microsoft\\PowerToys\\ImageResizer"); - } - catch (...) - { - er = ERROR_INSTALL_FAILURE; - } - - er = er == ERROR_SUCCESS ? (SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE) : er; - return WcaFinalize(er); -} - -UINT __stdcall CleanFileLocksmithRuntimeRegistryCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - hr = WcaInitialize(hInstall, "CleanFileLocksmithRuntimeRegistryCA"); - try - { - const wchar_t* CLSID_STR = L"{84D68575-E186-46AD-B0CB-BAEB45EE29C0}"; - auto deleteKeyRecursive = [](HKEY root, const std::wstring& path) { - RegDeleteTreeW(root, path.c_str()); - }; - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\" + std::wstring(CLSID_STR)); - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\AllFileSystemObjects\\ShellEx\\ContextMenuHandlers\\FileLocksmithExt"); - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\Drive\\ShellEx\\ContextMenuHandlers\\FileLocksmithExt"); - RegDeleteTreeW(HKEY_CURRENT_USER, L"Software\\Microsoft\\PowerToys\\FileLocksmith"); - } - catch (...) - { - er = ERROR_INSTALL_FAILURE; - } - er = er == ERROR_SUCCESS ? (SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE) : er; - return WcaFinalize(er); -} - -UINT __stdcall CleanPowerRenameRuntimeRegistryCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - hr = WcaInitialize(hInstall, "CleanPowerRenameRuntimeRegistryCA"); - try - { - const wchar_t* CLSID_STR = L"{0440049F-D1DC-4E46-B27B-98393D79486B}"; - auto deleteKeyRecursive = [](HKEY root, const std::wstring& path) { - RegDeleteTreeW(root, path.c_str()); - }; - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\" + std::wstring(CLSID_STR)); - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\AllFileSystemObjects\\ShellEx\\ContextMenuHandlers\\PowerRenameExt"); - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\Directory\\background\\ShellEx\\ContextMenuHandlers\\PowerRenameExt"); - RegDeleteTreeW(HKEY_CURRENT_USER, L"Software\\Microsoft\\PowerToys\\PowerRename"); - } - catch (...) - { - er = ERROR_INSTALL_FAILURE; - } - er = er == ERROR_SUCCESS ? (SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE) : er; - return WcaFinalize(er); -} - -UINT __stdcall CleanNewPlusRuntimeRegistryCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - hr = WcaInitialize(hInstall, "CleanNewPlusRuntimeRegistryCA"); - try - { - const wchar_t* CLSID_STR = L"{FF90D477-E32A-4BE8-8CC5-A502A97F5401}"; - auto deleteKeyRecursive = [](HKEY root, const std::wstring& path) { - RegDeleteTreeW(root, path.c_str()); - }; - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\" + std::wstring(CLSID_STR)); - deleteKeyRecursive(HKEY_CURRENT_USER, L"Software\\Classes\\Directory\\background\\ShellEx\\ContextMenuHandlers\\NewPlusShellExtensionWin10"); - RegDeleteTreeW(HKEY_CURRENT_USER, L"Software\\Microsoft\\PowerToys\\NewPlus"); - } - catch (...) - { - er = ERROR_INSTALL_FAILURE; - } - er = er == ERROR_SUCCESS ? (SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE) : er; - return WcaFinalize(er); -} - -UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall) -{ - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - hr = WcaInitialize(hInstall, "TerminateProcessesCA"); - - std::vector processes; - const size_t maxProcesses = 4096; - DWORD bytes = maxProcesses * sizeof(processes[0]); - processes.resize(maxProcesses); - - if (!EnumProcesses(processes.data(), bytes, &bytes)) - { - return 1; - } - processes.resize(bytes / sizeof(processes[0])); - - std::array processesToTerminate = { - L"PowerToys.PowerLauncher.exe", - L"PowerToys.Settings.exe", - L"PowerToys.AdvancedPaste.exe", - L"PowerToys.Awake.exe", - L"PowerToys.FancyZones.exe", - L"PowerToys.FancyZonesEditor.exe", - L"PowerToys.FileLocksmithUI.exe", - L"PowerToys.MouseJumpUI.exe", - L"PowerToys.ColorPickerUI.exe", - L"PowerToys.AlwaysOnTop.exe", - L"PowerToys.RegistryPreview.exe", - L"PowerToys.Hosts.exe", - L"PowerToys.PowerRename.exe", - L"PowerToys.ImageResizer.exe", - L"PowerToys.GcodeThumbnailProvider.exe", - L"PowerToys.BgcodeThumbnailProvider.exe", - L"PowerToys.PdfThumbnailProvider.exe", - L"PowerToys.MonacoPreviewHandler.exe", - L"PowerToys.MarkdownPreviewHandler.exe", - L"PowerToys.StlThumbnailProvider.exe", - L"PowerToys.SvgThumbnailProvider.exe", - L"PowerToys.GcodePreviewHandler.exe", - L"PowerToys.BgcodePreviewHandler.exe", - L"PowerToys.QoiPreviewHandler.exe", - L"PowerToys.PdfPreviewHandler.exe", - L"PowerToys.QoiThumbnailProvider.exe", - L"PowerToys.SvgPreviewHandler.exe", - L"PowerToys.Peek.UI.exe", - L"PowerToys.MouseWithoutBorders.exe", - L"PowerToys.MouseWithoutBordersHelper.exe", - L"PowerToys.MouseWithoutBordersService.exe", - L"PowerToys.CropAndLock.exe", - L"PowerToys.EnvironmentVariables.exe", - L"PowerToys.WorkspacesSnapshotTool.exe", - L"PowerToys.WorkspacesLauncher.exe", - L"PowerToys.WorkspacesLauncherUI.exe", - L"PowerToys.WorkspacesEditor.exe", - L"PowerToys.WorkspacesWindowArranger.exe", - L"Microsoft.CmdPal.UI.exe", - L"PowerToys.ZoomIt.exe", - L"PowerToys.exe", - }; - - for (const auto procID : processes) - { - if (!procID) - { - continue; - } - wchar_t processName[MAX_PATH] = L""; - - HANDLE hProcess{OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_TERMINATE, FALSE, procID)}; - if (!hProcess) - { - continue; - } - HMODULE hMod; - DWORD cbNeeded; - - if (!EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) - { - CloseHandle(hProcess); - continue; - } - GetModuleBaseNameW(hProcess, hMod, processName, sizeof(processName) / sizeof(wchar_t)); - - for (const auto processToTerminate : processesToTerminate) - { - if (processName == processToTerminate) - { - const DWORD timeout = 500; - auto windowEnumerator = [](HWND hwnd, LPARAM procIDPtr) -> BOOL - { - auto targetProcID = *reinterpret_cast(procIDPtr); - DWORD windowProcID = 0; - GetWindowThreadProcessId(hwnd, &windowProcID); - if (windowProcID == targetProcID) - { - DWORD_PTR _{}; - SendMessageTimeoutA(hwnd, WM_CLOSE, 0, 0, SMTO_BLOCK, timeout, &_); - } - return TRUE; - }; - EnumWindows(windowEnumerator, reinterpret_cast(&procID)); - Sleep(timeout); - TerminateProcess(hProcess, 0); - break; - } - } - CloseHandle(hProcess); - } - - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - -void initSystemLogger() -{ - static std::once_flag initLoggerFlag; - std::call_once(initLoggerFlag, []() - { - WCHAR temp_path[MAX_PATH]; - auto ret = GetTempPath(MAX_PATH, temp_path); - - if (ret) - { - Logger::init("PowerToysMSI", std::wstring{ temp_path } + L"\\PowerToysMSIInstaller", L""); - } }); -} - -// DllMain - Initialize and cleanup WiX custom action utils. -extern "C" BOOL WINAPI DllMain(__in HINSTANCE hInst, __in ULONG ulReason, __in LPVOID) -{ - switch (ulReason) - { - case DLL_PROCESS_ATTACH: - WcaGlobalInitialize(hInst); - initSystemLogger(); - TraceLoggingRegister(g_hProvider); - DLL_HANDLE = hInst; - break; - - case DLL_PROCESS_DETACH: - TraceLoggingUnregister(g_hProvider); - WcaGlobalFinalize(); - break; - } - - return TRUE; -} diff --git a/installer/PowerToysSetupCustomActions/CustomAction.def b/installer/PowerToysSetupCustomActions/CustomAction.def deleted file mode 100644 index 9467ca2204..0000000000 --- a/installer/PowerToysSetupCustomActions/CustomAction.def +++ /dev/null @@ -1,34 +0,0 @@ -LIBRARY "PowerToysSetupCustomActions" - -EXPORTS - LaunchPowerToysCA - CheckGPOCA - CleanVideoConferenceRegistryCA - ApplyModulesRegistryChangeSetsCA - DetectPrevInstallPathCA - RemoveScheduledTasksCA - TelemetryLogInstallSuccessCA - TelemetryLogInstallCancelCA - TelemetryLogInstallFailCA - TelemetryLogUninstallSuccessCA - TelemetryLogUninstallCancelCA - TelemetryLogUninstallFailCA - TelemetryLogRepairCancelCA - TelemetryLogRepairFailCA - TerminateProcessesCA - InstallEmbeddedMSIXCA - InstallDSCModuleCA - InstallCmdPalPackageCA - UnApplyModulesRegistryChangeSetsCA - UnRegisterCmdPalPackageCA - UnRegisterContextMenuPackagesCA - UninstallEmbeddedMSIXCA - UninstallDSCModuleCA - UninstallServicesCA - UninstallCommandNotFoundModuleCA - UpgradeCommandNotFoundModuleCA - UnsetAdvancedPasteAPIKeyCA - CleanImageResizerRuntimeRegistryCA - CleanFileLocksmithRuntimeRegistryCA - CleanPowerRenameRuntimeRegistryCA - CleanNewPlusRuntimeRegistryCA diff --git a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj deleted file mode 100644 index 0974bddbf9..0000000000 --- a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - {32f3882b-f2d6-4586-b5ed-11e39e522bd3} - Win32Proj - PowerToysSetupCustomActions - PowerToysSetupCustomActions - - - - DynamicLibrary - Unicode - v143 - - - DynamicLibrary - Unicode - true - v143 - - - - - - - - - - - - - - $(Platform)\$(Configuration)\MachineSetup\ - $(Platform)\$(Configuration)\UserSetup\ - $(SolutionDir)$(ProjectName)\$(Platform)\$(Configuration)\MachineSetup\obj\ - $(SolutionDir)$(ProjectName)\$(Platform)\$(Configuration)\UserSetup\obj\ - - false - true - - - true - - - false - ..\..\src\common\Telemetry;$(IncludePath) - - - - - call cmd /C "copy ""$(ProjectDir)DepsFilesLists.h"" ""$(ProjectDir)DepsFilesLists.h.bk""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\AdvancedPaste.wxs"" ""$(ProjectDir)..\PowerToysSetup\AdvancedPaste.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Awake.wxs"" ""$(ProjectDir)..\PowerToysSetup\Awake.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\BaseApplications.wxs"" ""$(ProjectDir)..\PowerToysSetup\BaseApplications.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\CmdPal.wxs"" ""$(ProjectDir)..\PowerToysSetup\CmdPal.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\ColorPicker.wxs"" ""$(ProjectDir)..\PowerToysSetup\ColorPicker.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Core.wxs"" ""$(ProjectDir)..\PowerToysSetup\Core.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\EnvironmentVariables.wxs"" ""$(ProjectDir)..\PowerToysSetup\EnvironmentVariables.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\FileExplorerPreview.wxs"" ""$(ProjectDir)..\PowerToysSetup\FileExplorerPreview.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\FileLocksmith.wxs"" ""$(ProjectDir)..\PowerToysSetup\FileLocksmith.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Hosts.wxs"" ""$(ProjectDir)..\PowerToysSetup\Hosts.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\ImageResizer.wxs"" ""$(ProjectDir)..\PowerToysSetup\ImageResizer.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\KeyboardManager.wxs"" ""$(ProjectDir)..\PowerToysSetup\KeyboardManager.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\MouseWithoutBorders.wxs"" ""$(ProjectDir)..\PowerToysSetup\MouseWithoutBorders.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\NewPlus.wxs"" ""$(ProjectDir)..\PowerToysSetup\NewPlus.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Peek.wxs"" ""$(ProjectDir)..\PowerToysSetup\Peek.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\PowerRename.wxs"" ""$(ProjectDir)..\PowerToysSetup\PowerRename.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Product.wxs"" ""$(ProjectDir)..\PowerToysSetup\Product.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\RegistryPreview.wxs"" ""$(ProjectDir)..\PowerToysSetup\RegistryPreview.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Resources.wxs"" ""$(ProjectDir)..\PowerToysSetup\Resources.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Run.wxs"" ""$(ProjectDir)..\PowerToysSetup\Run.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Settings.wxs"" ""$(ProjectDir)..\PowerToysSetup\Settings.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\ShortcutGuide.wxs"" ""$(ProjectDir)..\PowerToysSetup\ShortcutGuide.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Tools.wxs"" ""$(ProjectDir)..\PowerToysSetup\Tools.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\WinAppSDK.wxs"" ""$(ProjectDir)..\PowerToysSetup\WinAppSDK.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\WinUI3Applications.wxs"" ""$(ProjectDir)..\PowerToysSetup\WinUI3Applications.wxs.bk"""" - call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Workspaces.wxs"" ""$(ProjectDir)..\PowerToysSetup\Workspaces.wxs.bk"""" - if not "$(NormalizedPerUserValue)" == "true" call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetup\generateAllFileComponents.ps1 -platform $(Platform) - if "$(NormalizedPerUserValue)" == "true" call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetup\generateAllFileComponents.ps1 -platform $(Platform) -installscopeperuser $(NormalizedPerUserValue) - - Backing up original files and populating .NET and WPF Runtime dependencies for WiX3 based installer - - - - false - false - - - - inc;..\..\src\;..\..\src\common\Telemetry;telemetry;$(WixSdkPath)VS2017\inc;%(AdditionalIncludeDirectories) - /await /Zc:twoPhase- /Wv:18 %(AdditionalOptions) - Level4 - ProgramDatabase - - - Userenv.lib;Wtsapi32.lib;WindowsApp.lib;Newdev.lib;Crypt32.lib;msi.lib;wcautil.lib;Psapi.lib;Pathcch.lib;comsupp.lib;taskschd.lib;Secur32.lib;msi.lib;dutil.lib;wcautil.lib;Version.lib;Shlwapi.lib;%(AdditionalDependencies) - CustomAction.def - - - - - WIN64;%(PreprocessorDefinitions) - - - $(WixSdkPath)VS2017\lib\$(Platform);%(AdditionalLibraryDirectories) - - - - - Disabled - _DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - true - Windows - HighestAvailable - - - - - MaxSpeed - true - NDEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - true - - - true - Windows - true - true - HighestAvailable - - - - - - Create - - - - - - - - - - - - - - - - - - - - {d9b8fc84-322a-4f9f-bbb9-20915c47ddfd} - - - {8f021b46-362b-485c-bfba-ccf83e820cbd} - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj.filters b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj.filters deleted file mode 100644 index f4cf974dc0..0000000000 --- a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj.filters +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - Telemetry - - - Telemetry - - - - - - - - - - - - {6e73ce5d-e715-4e7e-b796-c5d180b07ff2} - - - - - - \ No newline at end of file diff --git a/installer/PowerToysSetupCustomActions/RcResource.h b/installer/PowerToysSetupCustomActions/RcResource.h deleted file mode 100644 index aabbb532bc..0000000000 --- a/installer/PowerToysSetupCustomActions/RcResource.h +++ /dev/null @@ -1,63 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include - -class RcResource -{ -public: - const std::byte* _memory = nullptr; - size_t _size = 0; - - static inline std::optional create(int resource_id, const std::wstring_view resource_class, const HINSTANCE handle = nullptr) - { - const HRSRC resHandle = FindResourceW(handle, MAKEINTRESOURCEW(resource_id), resource_class.data()); - if (!resHandle) - { - return std::nullopt; - } - - const HGLOBAL memHandle = LoadResource(handle, resHandle); - if (!memHandle) - { - return std::nullopt; - } - - const size_t resSize = SizeofResource(handle, resHandle); - if (!resSize) - { - return std::nullopt; - } - - auto res = static_cast(LockResource(memHandle)); - if (!res) - { - return std::nullopt; - } - - return RcResource{ res, resSize }; - } - - inline bool saveAsFile(const std::filesystem::path destination) - { - std::fstream installerFile{ destination, std::ios_base::binary | std::ios_base::out | std::ios_base::trunc }; - if (!installerFile.is_open()) - { - return false; - } - - installerFile.write(reinterpret_cast(_memory), _size); - return true; - } - -private: - RcResource() = delete; - RcResource(const std::byte* memory, size_t size) : - _memory{ memory }, _size{ size } - { - } -}; diff --git a/installer/PowerToysSetupCustomActions/Resource.rc b/installer/PowerToysSetupCustomActions/Resource.rc deleted file mode 100644 index c5f90c330d..0000000000 --- a/installer/PowerToysSetupCustomActions/Resource.rc +++ /dev/null @@ -1,96 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include -#include "resource.h" -#include "../../src/common/version/version.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -1 VERSIONINFO -FILEVERSION FILE_VERSION -PRODUCTVERSION PRODUCT_VERSION -FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG -FILEFLAGS VS_FF_DEBUG -#else -FILEFLAGS 0x0L -#endif -FILEOS VOS_NT_WINDOWS32 -FILETYPE VFT_DLL -FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset - BEGIN - VALUE "CompanyName", COMPANY_NAME - VALUE "FileDescription", FILE_DESCRIPTION - VALUE "FileVersion", FILE_VERSION_STRING - VALUE "InternalName", INTERNAL_NAME - VALUE "LegalCopyright", COPYRIGHT_NOTE - VALUE "OriginalFilename", ORIGINAL_FILENAME - VALUE "ProductName", PRODUCT_NAME - VALUE "ProductVersion", PRODUCT_VERSION_STRING - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset - END -END - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) -LANGUAGE 25, 1 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - -// TODO: Use to activate embedded MSIX -//IDR_BIN_MSIX_HELLO_PACKAGE BIN "..\\..\..\\src\\modules\\HelloModule\\AppPackages\\HelloModule_1.0.0.0_x64_Test\\HelloModule_1.0.0.0_x64.msix" - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/installer/PowerToysSetupCustomActions/packages.config b/installer/PowerToysSetupCustomActions/packages.config deleted file mode 100644 index 09bfc449e2..0000000000 --- a/installer/PowerToysSetupCustomActions/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/installer/PowerToysSetupCustomActions/pch.cpp b/installer/PowerToysSetupCustomActions/pch.cpp deleted file mode 100644 index 64b7eef6d6..0000000000 --- a/installer/PowerToysSetupCustomActions/pch.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// pch.cpp: source file corresponding to the pre-compiled header - -#include "pch.h" - -// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/installer/PowerToysSetupCustomActions/pch.h b/installer/PowerToysSetupCustomActions/pch.h deleted file mode 100644 index ebfdd0c258..0000000000 --- a/installer/PowerToysSetupCustomActions/pch.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define DPSAPI_VERSION 1 -// Windows Header Files: -#include -#include -#include -#include -#include -#include - -// WiX Header Files: -#include - -#define SECURITY_WIN32 -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include diff --git a/installer/PowerToysSetupCustomActions/resource.h b/installer/PowerToysSetupCustomActions/resource.h deleted file mode 100644 index d31a222438..0000000000 --- a/installer/PowerToysSetupCustomActions/resource.h +++ /dev/null @@ -1,20 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Resource.rc - -#define FILE_DESCRIPTION "PowerToys Setup Custom Actions" -#define INTERNAL_NAME "PowerToysSetupCustomActions" -#define ORIGINAL_FILENAME "PowerToysSetupCustomActions.dll" - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif - -#define IDR_BIN_MSIX_HELLO_PACKAGE 101 diff --git a/installer/PowerToysSetupVNext/Common.wxi b/installer/PowerToysSetupVNext/Common.wxi index 4bb4f5a1dc..21855a7936 100644 --- a/installer/PowerToysSetupVNext/Common.wxi +++ b/installer/PowerToysSetupVNext/Common.wxi @@ -37,7 +37,7 @@ - + @@ -46,7 +46,7 @@ - + diff --git a/installer/PowerToysSetupVNext/PowerToysBootstrapperVNext.wixproj b/installer/PowerToysSetupVNext/PowerToysBootstrapperVNext.wixproj index 1a3a4a8cac..6b17b17030 100644 --- a/installer/PowerToysSetupVNext/PowerToysBootstrapperVNext.wixproj +++ b/installer/PowerToysSetupVNext/PowerToysBootstrapperVNext.wixproj @@ -3,7 +3,7 @@ false - Version=$(Version);InstallerSuffix=$(InstallerSuffix) + Version=$(Version) PowerToysVNextBootstrapper @@ -22,12 +22,11 @@ Release x64 arm64 - wix5 - PowerToysSetup-$(Version)-$(InstallerSuffix)-$(Platform) + PowerToysSetup-$(Version)-$(Platform) Bundle True - PowerToysSetup-$(Version)-$(InstallerSuffix)-$(Platform) - PowerToysUserSetup-$(Version)-$(InstallerSuffix)-$(Platform) + PowerToysSetup-$(Version)-$(Platform) + PowerToysUserSetup-$(Version)-$(Platform) $(Platform)\$(Configuration)\MachineSetup $(Platform)\$(Configuration)\UserSetup $(BaseIntermediateOutputPath)$(Platform)\$(Configuration)\MachineSetup diff --git a/installer/PowerToysSetupVNext/PowerToysInstallerVNext.wixproj b/installer/PowerToysSetupVNext/PowerToysInstallerVNext.wixproj index 5341f66768..afce3d396d 100644 --- a/installer/PowerToysSetupVNext/PowerToysInstallerVNext.wixproj +++ b/installer/PowerToysSetupVNext/PowerToysInstallerVNext.wixproj @@ -4,7 +4,7 @@ false - Version=$(Version);MonacoSRCHarvestPath=$(ProjectDir)..\..\x64\$(Configuration)\Assets\Monaco\monacoSRC;CmdPalVersion=$(CmdPalVersion);InstallerSuffix=$(InstallerSuffix) @@ -18,7 +18,7 @@ call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuil - Version=$(Version);MonacoSRCHarvestPath=$(ProjectDir)..\..\ARM64\$(Configuration)\Assets\Monaco\monacoSRC;CmdPalVersion=$(CmdPalVersion);InstallerSuffix=$(InstallerSuffix) + Version=$(Version);MonacoSRCHarvestPath=$(ProjectDir)..\..\ARM64\$(Configuration)\Assets\Monaco\monacoSRC;CmdPalVersion=$(CmdPalVersion) IF NOT DEFINED IsPipeline ( call "$([MSBuild]::GetVsInstallRoot())\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=amd64 -winsdk=10.0.19041.0 -vcvars_ver=$(VCToolsVersion) SET PTRoot=$(SolutionDir)\.. @@ -80,9 +80,8 @@ call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuil 3.10 {b6e94700-df38-41f6-a3fd-18b69674ab1e} 2.0 - wix5 - PowerToysSetup-$(Version)-$(InstallerSuffix)-$(Platform) - PowerToysUserSetup-$(Version)-$(InstallerSuffix)-$(Platform) + PowerToysSetup-$(Version)-$(Platform) + PowerToysUserSetup-$(Version)-$(Platform) Package True diff --git a/installer/wix.props b/installer/wix.props deleted file mode 100644 index d33624a8c7..0000000000 --- a/installer/wix.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - C:\Program Files (x86)\WiX Toolset v3.14\bin\ - $(WixInstallPath)\ - - $(WixInstallPath)\..\wix.targets - $(WixInstallPath)\..\lux.targets - - $(WixInstallPath)\WixTasks.dll - $(WixInstallPath)\..\sdk\ - $(WixSdkPath)\..\wix.ca.targets - - \ No newline at end of file diff --git a/tools/build/build-installer.ps1 b/tools/build/build-installer.ps1 index f601146577..83a47f2092 100644 --- a/tools/build/build-installer.ps1 +++ b/tools/build/build-installer.ps1 @@ -21,12 +21,9 @@ Specifies the build configuration (e.g., 'Debug', 'Release'). Default is 'Releas .PARAMETER PerUser Specifies whether to build a per-user installer (true) or machine-wide installer (false). Default is true (per-user). -.PARAMETER InstallerSuffix -Specifies the suffix for the installer naming (e.g., 'wix5', 'vnext'). Default is 'wix5'. - .EXAMPLE .\build-installer.ps1 -Runs the installer build pipeline for x64 Release with default suffix (wix5). +Runs the installer build pipeline for x64 Release. .EXAMPLE .\build-installer.ps1 -Platform x64 -Configuration Release @@ -36,10 +33,6 @@ Runs the pipeline for x64 Release. .\build-installer.ps1 -Platform x64 -Configuration Release -PerUser false Runs the pipeline for x64 Release with machine-wide installer. -.EXAMPLE -.\build-installer.ps1 -Platform x64 -Configuration Release -InstallerSuffix vnext -Runs the pipeline for x64 Release with 'vnext' suffix. - .NOTES - Make sure to run this script from a Developer PowerShell (e.g., VS2022 Developer PowerShell). - Generated MSIX files will be signed using cert-sign-package.ps1. @@ -54,8 +47,7 @@ Runs the pipeline for x64 Release with 'vnext' suffix. param ( [string]$Platform = '', [string]$Configuration = 'Release', - [string]$PerUser = 'true', - [string]$InstallerSuffix = 'wix5' + [string]$PerUser = 'true' ) # Ensure helpers are available @@ -97,7 +89,7 @@ if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot "PowerToys.sln"))) { } Write-Host "PowerToys repository root detected: $repoRoot" -# WiX v5 projects use WixToolset.Sdk via NuGet/MSBuild; a separate WiX 3 installation is not required here. +# WiX v5 projects use WixToolset.Sdk via NuGet/MSBuild; no separate WiX installation is required. Write-Host ("[PIPELINE] Start | Platform={0} Configuration={1} PerUser={2}" -f $Platform, $Configuration, $PerUser) Write-Host '' @@ -151,8 +143,8 @@ try { RunMSBuild 'installer\PowerToysSetup.sln' "$commonArgs /t:restore /p:RestorePackagesConfig=true" $Platform $Configuration -RunMSBuild 'installer\PowerToysSetup.sln' "$commonArgs /m /t:PowerToysInstallerVNext /p:PerUser=$PerUser /p:InstallerSuffix=$InstallerSuffix" $Platform $Configuration +RunMSBuild 'installer\PowerToysSetup.sln' "$commonArgs /m /t:PowerToysInstallerVNext /p:PerUser=$PerUser" $Platform $Configuration -RunMSBuild 'installer\PowerToysSetup.sln' "$commonArgs /m /t:PowerToysBootstrapperVNext /p:PerUser=$PerUser /p:InstallerSuffix=$InstallerSuffix" $Platform $Configuration +RunMSBuild 'installer\PowerToysSetup.sln' "$commonArgs /m /t:PowerToysBootstrapperVNext /p:PerUser=$PerUser" $Platform $Configuration Write-Host '[PIPELINE] Completed' diff --git a/tools/build/ensure-wix.ps1 b/tools/build/ensure-wix.ps1 deleted file mode 100644 index 988d382f07..0000000000 --- a/tools/build/ensure-wix.ps1 +++ /dev/null @@ -1,71 +0,0 @@ -<# -.SYNOPSIS - Ensure WiX Toolset 3.14 (build 3141) is installed and ready to use. - -.DESCRIPTION - - Skips installation if the toolset is already installed (unless -Force is used). - - Otherwise downloads the official installer and binaries, verifies SHA-256, installs silently, - and copies wix.targets into the installation directory. -.PARAMETER Force - Forces reinstallation even if the toolset is already detected. -.PARAMETER InstallDir - The target installation path. Default is 'C:\Program Files (x86)\WiX Toolset v3.14'. -.EXAMPLE - .\EnsureWix.ps1 # Ensure WiX is installed - .\EnsureWix.ps1 -Force # Force reinstall -#> -[CmdletBinding()] -param( - [switch]$Force, - [string]$InstallDir = 'C:\Program Files (x86)\WiX Toolset v3.14' -) - -$ErrorActionPreference = 'Stop' -$ProgressPreference = 'SilentlyContinue' - -# Download URLs and expected SHA-256 hashes -$WixDownloadUrl = 'https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314.exe' -$WixBinariesDownloadUrl = 'https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip' -$InstallerHashExpected = '6BF6D03D6923D9EF827AE1D943B90B42B8EBB1B0F68EF6D55F868FA34C738A29' -$BinariesHashExpected = '6AC824E1642D6F7277D0ED7EA09411A508F6116BA6FAE0AA5F2C7DAA2FF43D31' - -# Check if WiX is already installed -$candlePath = Join-Path $InstallDir 'bin\candle.exe' -if (-not $Force -and (Test-Path $candlePath)) { - Write-Host "WiX Toolset is already installed at `"$InstallDir`". Skipping installation." - return -} - -# Temp file paths -$tmpDir = [IO.Path]::GetTempPath() -$installer = Join-Path $tmpDir 'wix314.exe' -$binariesZip = Join-Path $tmpDir 'wix314-binaries.zip' - -# Download installer and binaries -Write-Host 'Downloading WiX installer...' -Invoke-WebRequest -Uri $WixDownloadUrl -OutFile $installer -UseBasicParsing -Write-Host 'Downloading WiX binaries...' -Invoke-WebRequest -Uri $WixBinariesDownloadUrl -OutFile $binariesZip -UseBasicParsing - -# Verify SHA-256 hashes -Write-Host 'Verifying installer hash...' -if ((Get-FileHash -Algorithm SHA256 $installer).Hash -ne $InstallerHashExpected) { - throw 'wix314.exe SHA256 hash mismatch' -} -Write-Host 'Verifying binaries hash...' -if ((Get-FileHash -Algorithm SHA256 $binariesZip).Hash -ne $BinariesHashExpected) { - throw 'wix314-binaries.zip SHA256 hash mismatch' -} - -# Perform silent installation -Write-Host 'Installing WiX Toolset silently...' -Start-Process -FilePath $installer -ArgumentList '/install','/quiet' -Wait - -# Extract binaries and copy wix.targets -$expandDir = Join-Path $tmpDir 'wix-binaries' -if (Test-Path $expandDir) { Remove-Item $expandDir -Recurse -Force } -Expand-Archive -Path $binariesZip -DestinationPath $expandDir -Force -Copy-Item -Path (Join-Path $expandDir 'wix.targets') ` - -Destination (Join-Path $InstallDir 'wix.targets') -Force - -Write-Host "WiX Toolset has been successfully installed at: $InstallDir"