2019-09-05 00:26:26 +08:00
# PowerToys Setup Project
## Build instructions
* Install the [WiX Toolset Visual Studio 2019 Extension ](https://marketplace.visualstudio.com/items?itemName=RobMensching.WiXToolset ).
* Install the [WiX Toolset build tools ](https://wixtoolset.org/releases/ ) in the development machine.
* Open `powertoys.sln` , select the "Release" and "x64" configurations and build the `PowerToysSetup` project.
* The resulting installer will be built to `PowerToysSetup\bin\Release\PowerToysSetup.msi` .
2019-12-18 18:19:15 +08:00
## Building and installing self-signed PowerToys MSIX package
2020-01-16 02:15:24 +08:00
For the first-time installation, you'll need to generate a self-signed certificate. The script below will generate and add a cert to your [TRCA store ](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/trusted-root-certification-authorities-certificate-store ).
1. Open `Developer PowerShell for VS` as an Admin
2. Navigate to your repo's `installer\MSIX`
3. Run `.\generate_self_sign_cert.ps1`
2019-12-21 00:12:52 +08:00
2020-01-16 02:15:24 +08:00
## To Build
1. Make sure you've built the `Release` configuration of `powertoys.sln`
2. Open `Developer PowerShell for VS`
3. Navigate to your repo's `installer\MSIX`
4. Run `.\msix_reinstall.ps1` from the devenv powershell
2019-12-21 00:12:52 +08:00
2020-01-16 02:15:24 +08:00
### What msix_reinstall.ps1 does
2019-12-21 00:12:52 +08:00
`msix_reinstall.ps1` removes the current PowerToys installation, restarts explorer.exe (to update PowerRename shell extension), builds `PowerToys-x64.msix` package, signs it with a PowerToys_TemporaryKey.pfx, and finally installs it.
2020-01-16 02:15:24 +08:00
#### Removing all .msi/.msix PowerToys installations
2019-12-18 18:19:15 +08:00
```ps
$name='PowerToys'
Get-AppxPackage -Name $name | select -ExpandProperty "PackageFullName" | Remove-AppxPackage
gwmi win32_product -filter "Name = '$name'" -namespace root/cimv2 | foreach {
if ($_.uninstall().returnvalue -eq 0) { write-host "Successfully uninstalled $name " }
else { write-warning "Failed to uninstall $name." }
}
```