Skip to content

Commit

Permalink
[Setup] Use WiX bootstrapper instead of a custom one (#15050)
Browse files Browse the repository at this point in the history
@DHowett gave approval on teams.  Squash merging
  • Loading branch information
yuyoyuppe authored Jan 5, 2022
1 parent 244a3b9 commit 3d59c79
Show file tree
Hide file tree
Showing 34 changed files with 1,708 additions and 2,670 deletions.
23 changes: 23 additions & 0 deletions .github/actions/spell-check/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,16 @@ AWAYMODE
AYUV
backend
backtracer
BAEC
BAF
bak
bbwe
bck
Bcl
BEEE
betadele
betsegaw
BFB
BGR
bgra
BGSOUNDS
Expand Down Expand Up @@ -157,6 +161,7 @@ boolalpha
Bools
Boostrapper
bootstrapper
BOOTSTRAPPERINSTALLFOLDER
Bopomofo
BOTTOMALIGN
BPBF
Expand All @@ -175,6 +180,7 @@ buf
BUFSIZE
bugreport
Buid
BUILDARCH
buildtransitive
BValue
bytearray
Expand All @@ -195,6 +201,7 @@ CDeclaration
CDEF
cdpx
CENTERALIGN
CFDB
cguid
changecursor
Changemove
Expand Down Expand Up @@ -352,6 +359,8 @@ Datavalue
DATAW
davidegiacometti
Dayof
DBCD
DBDA
dbg
Dbghelp
DBLCLKS
Expand All @@ -367,6 +376,7 @@ declspec
decltype
Dedup
deduplicate
DEFAULTBOOTSTRAPPERINSTALLFOLDER
DEFAULTCOLOR
DEFAULTFLAGS
DEFAULTONLY
Expand Down Expand Up @@ -477,13 +487,18 @@ dwrite
dxgi
dxgiformat
dxguid
EAF
EBA
EBE
ecount
ededf
EDITKEYBOARD
editkeyboardwindow
editorconfig
EDITSHORTCUTS
editshortcutswindow
EFBD
efgh
EFile
egistry
ekus
Expand Down Expand Up @@ -551,7 +566,10 @@ FANCYZONESDRAWLAYOUTTEST
FANCYZONESEDITOR
Farbraum
FARPROC
FBF
FCCD
fdw
FEEBD
feimage
ffaa
fff
Expand Down Expand Up @@ -850,6 +868,8 @@ INPUTTYPE
INSTALLDESKTOPSHORTCUT
INSTALLDIR
INSTALLFOLDER
INSTALLFOLDERTOBOOTSTRAPPERINSTALLFOLDER
INSTALLFOLDERTOPREVIOUSINSTALLFOLDER
INSTALLLOCATION
INSTALLLOGATTRIBUTES
INSTALLLOGMODE
Expand Down Expand Up @@ -1365,6 +1385,7 @@ outro
outsettings
OVERLAPPEDWINDOW
overlaywindow
Overridable
OWNDC
PACL
PAINTSTRUCT
Expand Down Expand Up @@ -1463,6 +1484,7 @@ previewer
PREVIEWHANDLERFRAMEINFO
previewpane
previouscamera
PREVIOUSINSTALLFOLDER
PREVIOUSVERSIONSINSTALLED
prevpane
prgms
Expand Down Expand Up @@ -2100,6 +2122,7 @@ wcsncmp
wcsnicmp
wdp
wdupenv
We'd
weakme
webcam
webpage
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/ESRPSigning_core.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"SignBatches": [
{
"MatchedPath": [
"!(ModernWpf)*.resources.dll",
"*.resources.dll",

"PowerToysSetupCustomActions.dll",

Expand Down
5 changes: 5 additions & 0 deletions .pipelines/build-installer-MSI.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cd /D "%~dp0"

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.18362.0
SET IsPipeline=1
call msbuild ../installer/PowerToysSetup.sln /target:PowerToysInstaller /p:Configuration=Release /p:Platform=x64 /p:CIBuild=true || exit /b 1
19 changes: 0 additions & 19 deletions .pipelines/ci/templates/build-powertoys-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,6 @@ steps:
msbuildArgs: ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true

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

- task: VSBuild@1
displayName: 'Build PowerToysBootstrapper.sln'
inputs:
solution: '**\installer\PowerToysBootstrapper\PowerToysBootstrapper.sln'
vsVersion: 16.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
maximumCpuCount: true

# directly not doing WinAppDriver testing
- task: VSTest@2
displayName: 'MS Tests'
Expand Down
48 changes: 45 additions & 3 deletions .pipelines/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ jobs:
inputs:
solution: '**/installer/PowerToysSetup.sln'
vsVersion: 16.0
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
msbuildArgs: /p:CIBuild=true /target:PowerToysInstaller /bl:$(Build.SourcesDirectory)\msbuild.binlog
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: true
Expand All @@ -231,19 +231,61 @@ jobs:
- task: VSBuild@1
displayName: Build Bootstrapper
inputs:
solution: '**/installer/PowerToysBootstrapper/PowerToysBootstrapper.sln'
solution: '**/installer/PowerToysSetup.sln'
vsVersion: 16.0
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: true
maximumCpuCount: true

- task: CmdLine@2
displayName: 'Insignia: Extract Engine from Bundle'
inputs:
script: '.\installer\packages\WiX.3.11.2\tools\insignia.exe -ib installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ 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: '.\installer\packages\WiX.3.11.2\tools\insignia.exe -ab installer\engine.exe installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).exe -o installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).exe'

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: Sign Boostrapper
inputs:
ConnectedServiceName: 'Terminal/Console/WinAppDriver Team Code Signing Connection'
FolderPath: 'installer/PowerToysBootstrapper/$(BuildPlatform)\$(BuildConfiguration)'
FolderPath: 'installer/PowerToysSetup/$(BuildPlatform)\$(BuildConfiguration)'
signType: batchSigning
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json'
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
Expand Down
2 changes: 1 addition & 1 deletion doc/devdocs/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ We use the awesome [spdlog](https://github.com/gabime/spdlog) library for loggin
<Import Project="..\..\..\deps\spdlog.props" />
```
It'll add the required include dirs and link the library binary itself.
You can see many example usage of the library in its repository or in the [bootstrapper project](../../installer/PowerToysBootstrapper/bootstrapper/bootstrapper.cpp).

11 changes: 1 addition & 10 deletions doc/devdocs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ The installer can only be compiled in `Release` mode, step 1 and 2 must be done
2. Compile `BugReportTool.sln` tool. Path from root: `tools\BugReportTool\BugReportTool.sln` (details listed below)
3. Compile `WebcamReportTool.sln` tool. Path from root: `tools\WebcamReportTool\WebcamReportTool.sln` (details listed below)
4. Compile `PowerToysSetup.sln` Path from root: `installer\PowerToysSetup.sln` (details listed below)
5. Compile `PowerToysBootstrapper.sln` Path from root: `installer\PowerToysBootstrapper\PowerToysBootstrapper.sln` (details listed below)

### Prerequisites for building the MSI installer

Expand All @@ -85,22 +84,14 @@ The installer can only be compiled in `Release` mode, step 1 and 2 must be done
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu, choose `Build Solution`.

### Locally compiling the .MSI installer
### Locally compiling the installer

1. Open `installer\PowerToysSetup.sln`
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu choose `Build Solution`.

The resulting `PowerToysSetup.msi` installer will be available in the `installer\PowerToysSetup\x64\Release\` folder.

### Locally compiling the .EXE Bootstrapper installer

1. Open `installer\PowerToysBootstrapper\PowerToysBootstrapper.sln`
2. In Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`
3. From the `Build` menu choose `Build Solution`.

The `PowerToysSetup-0.0.1-x64.exe` binary is created in the `installer\PowerToysBootstrapper\x64\Release\` folder.

#### Supported arguments for the .EXE Bootstrapper installer

Head over to the wiki to see the [full list of supported installer arguments][installerArgWiki].
Expand Down
43 changes: 0 additions & 43 deletions installer/PowerToysBootstrapper/PowerToysBootstrapper.sln

This file was deleted.

Loading

0 comments on commit 3d59c79

Please sign in to comment.