forked from microsoft/PowerToys
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[installer] Support per-user installation (microsoft#24087)
* Add per user installer * Separate upgrade codes for per machine and per user installation Move per machine check to bootstrapper Move all defines to common.wxs Fix CI * Update installer/PowerToysSetup/generateFileList.ps1 Co-authored-by: Jeremy Sinclair <[email protected]> * Update installer/PowerToysSetup/generateAllFileComponents.ps1 Co-authored-by: Jeremy Sinclair <[email protected]> * Update installer/PowerToysSetup/generateFileList.ps1 Co-authored-by: Jeremy Sinclair <[email protected]> * expect.txt * Revert "Update installer/PowerToysSetup/generateFileList.ps1" This reverts commit 34545da. * Update release CI to build both installers * Revert bundle name change It messes up app ID for per-user installation which ends up breaking winget update of the per-user PT * spellcheck * Fix bad merge * Add RegistryPreview * Include backup_restore_settings.json * Revert testing endpoint change --------- Co-authored-by: Jeremy Sinclair <[email protected]>
- Loading branch information
1 parent
07579c9
commit 870f8e3
Showing
48 changed files
with
3,244 additions
and
1,109 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
parameters: | ||
- name: versionNumber | ||
type: string | ||
default: "0.0.1" | ||
- name: perUserArg | ||
type: string | ||
default: "false" | ||
- name: buildSubDir | ||
type: string | ||
default: "MachineSetup" | ||
- name: installerPrefix | ||
type: string | ||
default: "PowerToysSetup" | ||
|
||
steps: | ||
- task: VSBuild@1 | ||
displayName: Build PowerToysSetupCustomActions DLL # This dll needs to be build and signed before building the MSI. | ||
inputs: | ||
solution: "**/installer/PowerToysSetup.sln" | ||
vsVersion: 17.0 | ||
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog /t:PowerToysSetupCustomActions /p:RunBuildEvents=true /p:PerUser=${{parameters.perUserArg}} | ||
platform: $(BuildPlatform) | ||
configuration: $(BuildConfiguration) | ||
clean: true | ||
maximumCpuCount: true | ||
|
||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 | ||
displayName: Sign PowerToysSetupCustomActions DLL | ||
inputs: | ||
ConnectedServiceName: "Terminal/Console/WinAppDriver Team Code Signing Connection" | ||
FolderPath: 'installer/PowerToysSetupCustomActions/$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}' | ||
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: Build MSI | ||
inputs: | ||
solution: "**/installer/PowerToysSetup.sln" | ||
vsVersion: 17.0 | ||
msbuildArgs: /p:CIBuild=true /target:PowerToysInstaller /bl:$(Build.SourcesDirectory)\msbuild.binlog /p:RunBuildEvents=false /p:PerUser=${{parameters.perUserArg}} | ||
platform: $(BuildPlatform) | ||
configuration: $(BuildConfiguration) | ||
clean: false # don't undo our hard work above by deleting the CustomActions dll | ||
maximumCpuCount: true | ||
|
||
- task: CmdLine@2 | ||
displayName: "Extracting MSI to verify contents" | ||
inputs: | ||
script: | | ||
"C:\Program Files (x86)\WiX Toolset v3.14\bin\dark.exe" -x $(build.sourcesdirectory)\extractedMsi installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}\${{parameters.installerPrefix}}-${{ parameters.versionNumber }}-$(BuildPlatform).msi | ||
dir $(build.sourcesdirectory)\extractedMsi | ||
# Did we sign all files | ||
- task: PowerShell@1 | ||
displayName: Verifying entire build is signed and version set | ||
inputs: | ||
scriptName: .pipelines/versionAndSignCheck.ps1 | ||
arguments: -targetDir '$(build.sourcesdirectory)\extractedMsi\File' | ||
|
||
- task: PowerShell@1 | ||
displayName: Verifying MSI Custom Actions DLL is signed | ||
inputs: | ||
scriptName: .pipelines/versionAndSignCheck.ps1 | ||
arguments: -targetDir '$(build.sourcesdirectory)\extractedMsi\Binary' | ||
|
||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 | ||
displayName: Sign MSI | ||
inputs: | ||
ConnectedServiceName: "Terminal/Console/WinAppDriver Team Code Signing Connection" | ||
FolderPath: 'installer/PowerToysSetup/$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}' | ||
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: Build Bootstrapper | ||
inputs: | ||
solution: "**/installer/PowerToysSetup.sln" | ||
vsVersion: 17.0 | ||
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog /t:PowerToysBootstrapper /p:PerUser=${{parameters.perUserArg}} | ||
platform: $(BuildPlatform) | ||
configuration: $(BuildConfiguration) | ||
clean: false # don't undo our hard work above by deleting the MSI | ||
maximumCpuCount: true | ||
|
||
- task: CmdLine@2 | ||
displayName: "Insignia: Extract Engine from Bundle" | ||
inputs: | ||
script: '"C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ib installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}\${{parameters.installerPrefix}}-${{ parameters.versionNumber }}-$(BuildPlatform).exe -o installer\engine.exe' | ||
|
||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 | ||
displayName: "ESRP CodeSigning (Engine)" | ||
inputs: | ||
ConnectedServiceName: "Terminal/Console/WinAppDriver Team Code Signing Connection" | ||
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" | ||
} | ||
] | ||
- task: CmdLine@2 | ||
displayName: "Insignia: Merge Engine into Bundle" | ||
inputs: | ||
script: '"C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ab installer\engine.exe installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}\${{parameters.installerPrefix}}-${{ parameters.versionNumber }}-$(BuildPlatform).exe -o installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}\${{parameters.installerPrefix}}-${{ parameters.versionNumber }}-$(BuildPlatform).exe' | ||
|
||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 | ||
displayName: Sign Bootstrapper | ||
inputs: | ||
ConnectedServiceName: "Terminal/Console/WinAppDriver Team Code Signing Connection" | ||
FolderPath: 'installer/PowerToysSetup/$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}' | ||
signType: batchSigning | ||
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' | ||
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' | ||
#### END BOOTSTRAP | ||
## END INSTALLER |
Oops, something went wrong.