Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[installer] Support per-user installation #24087

Merged
merged 21 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
65a7b88
Add per user installer
stefansjfw Jan 18, 2023
14f36cb
Separate upgrade codes for per machine and per user installation
stefansjfw Feb 8, 2023
a2eac05
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Feb 22, 2023
03ea420
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 7, 2023
34545da
Update installer/PowerToysSetup/generateFileList.ps1
stefansjfw Mar 7, 2023
f44ccca
Update installer/PowerToysSetup/generateAllFileComponents.ps1
stefansjfw Mar 7, 2023
4ba537d
Update installer/PowerToysSetup/generateFileList.ps1
stefansjfw Mar 7, 2023
9bc160f
expect.txt
stefansjfw Mar 7, 2023
68b2f57
Revert "Update installer/PowerToysSetup/generateFileList.ps1"
stefansjfw Mar 7, 2023
30af633
Update release CI to build both installers
stefansjfw Feb 23, 2023
8fc9014
Revert bundle name change
stefansjfw Mar 14, 2023
665a306
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 21, 2023
7235d87
spellcheck
stefansjfw Mar 21, 2023
7d983db
Fix bad merge
stefansjfw Mar 24, 2023
bf0e514
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 27, 2023
7357213
Add RegistryPreview
stefansjfw Mar 27, 2023
29ce624
Include backup_restore_settings.json
stefansjfw Mar 27, 2023
5373de9
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 28, 2023
2512cbf
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 29, 2023
98d3233
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 30, 2023
01f83f4
Revert testing endpoint change
stefansjfw Mar 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 176 additions & 19 deletions .github/actions/spell-check/expect.txt

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,3 @@ src/common/Telemetry/*.etl
/src/modules/previewpane/SvgThumbnailProvider/$(SolutionDir)$(Platform)/$(Configuration)/modules/FileExplorerPreview/SvgThumbnailProvider.xml
/src/modules/powerrename/ui/RCa24464
/src/modules/powerrename/ui/RCb24464

# Generated installer file for Monaco source files.
/installer/PowerToysSetup/MonacoSRC.wxs
1 change: 1 addition & 0 deletions .pipelines/ESRPSigning_core.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
"modules\\FileExplorerPreview\\Microsoft.Web.WebView2.Wpf.dll",
"modules\\FileExplorerPreview\\WebView2Loader.dll",
"modules\\Hosts\\Microsoft.Graphics.Canvas.Interop.dll",
"modules\\Hosts\\clrcompression.dll",
"modules\\launcher\\e_sqlite3.dll",
"modules\\launcher\\LazyCache.dll",
"modules\\launcher\\SQLitePCLRaw.batteries_v2.dll",
Expand Down
4 changes: 2 additions & 2 deletions .pipelines/ESRPSigning_installer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"MatchedPath": [
"PowerToysSetupCustomActions.dll",
"PowerToysSetup-*.exe",
"PowerToysSetup-*.msi"
"PowerToys*Setup-*.exe",
"PowerToys*Setup-*.msi"
],
"SigningInfo": {
"Operations": [
Expand Down
41 changes: 39 additions & 2 deletions .pipelines/ci/templates/build-powertoys-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ steps:
filePath: '$(build.sourcesdirectory)\.pipelines\installWiX.ps1'

- task: VSBuild@1
displayName: 'Build PowerToys MSI'
displayName: 'Build PowerToys per-machine MSI'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
Expand All @@ -163,7 +163,7 @@ steps:
maximumCpuCount: true

- task: VSBuild@1
displayName: 'Build PowerToys Bootstrapper'
displayName: 'Build PowerToys per-machine Bootstrapper'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
Expand All @@ -173,6 +173,43 @@ steps:
clean: false
maximumCpuCount: true

- task: PowerShell@2
displayName: Clean installer dir before building per-user installer
inputs:
targetType: inline
script: git clean -xfd -e *exe -- .\installer\
pwsh: true

- task: NuGetCommand@2
displayName: Restore NuGet packages for PowerToysSetup.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: installer\PowerToysSetup.sln
restoreDirectory: '$(Build.SourcesDirectory)\installer\packages'

- task: VSBuild@1
displayName: 'Build PowerToys per-user MSI'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: /t:PowerToysInstaller ${{ parameters.additionalBuildArguments }} /p:PerUser=true
maximumCpuCount: true

- task: VSBuild@1
displayName: 'Build PowerToys per-user Bootstrapper'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: /t:PowerToysBootstrapper ${{ parameters.additionalBuildArguments }} /p:PerUser=true
clean: false
maximumCpuCount: true

# directly not doing WinAppDriver testing
- task: VSTest@2
displayName: 'MS Tests'
Expand Down
141 changes: 141 additions & 0 deletions .pipelines/installer-steps.yml
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
Loading