- Launcher project - Builds the actual executable that is run when a user launches the app.
- DistroLauncher-Appx project - Builds the distro package with all the assets and other dependencies.
Read more about the components from the upstream template by Microsoft here.
- Visual Studio Community 2022. (Free)
- The "Universal Windows Platform development" Workload is required, along with the following Individual components:
C++ (v143) Universal Windows Platform tools- Recommended Version -
Windows 10 SDK (10.0.19041.0) or later for UWP: C#, VB, JS - Minimum Version -
Windows 10 SDK (10.0.17763.0) for UWP: C#, VB, JS
- The "Universal Windows Platform development" Workload is required, along with the following Individual components:
- Developer Mode
- Windows 10 must be in Developer mode, which can be enabled in Start -> Settings -> Update & Security -> For developers.
- Enable WSL
- Enable by:
- Pressing Windows+R, type
C:\Windows\System32\OptionalFeatures.exe, click OK, find and check Windows Subsystem for Linux, click OK, and restart as required, or - Open PowerShell as Administrator, type
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux, and restart as required.
- Pressing Windows+R, type
- Enable by:
- Open DistroLauncher.sln in Visual Studio Community 2022.
- Generate a test certificate:
As of Visual Studio 2019 and later (including 2022), the original feature to create Test Certificates have been removed in order to, "promote better security practices". A bug report has been filed, but it does not seem that this feature will be coming back soon. To address that bug report, Chris Paterson created a script which has this same feature.
Open Powershell and copy and paste this script into the prompt, it creates the test certificate for you:
$Subject = "CN=Your-appxmanifest-publisher"
$Store = "Cert:\CurrentUser\My"
# Delete old certificate
Get-ChildItem $Store | Where-Object { $_.Subject -match $Subject } | Remove-Item
# Create new certificate
New-SelfSignedCertificate -Type Custom -Subject $Subject -KeyUsage DigitalSignature -FriendlyName "Pengwin Test Certificate" -CertStoreLocation $Store -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}")
You will need the thumbprint later so be sure to copy it
-
Get or build install.tar.gz
- Get the most recent install.tar.gz files, and place in x64 or ARM64, or
- Build the install.tar.gz on an existing Debian or Pengwin system using the build scripts.
-
Updating the thumbprint
- Open the file
DistroLauncher-Appx\DistroLauncher-Appx.vcxproj - Search for the line that starts with
<PackageCertificateThumbprint> - Replace the string in the middle with the thumbprint that you copied earlier and save the file.
- Open the file
-
Build the solution to make sure you have everything you need. Fix any build dependencies you are missing.
-
Build the Windows UWP package: The package can be built in Visual Studio or via command line
- For a UI guided build
- Open
DistroLauncher.slnin Visual Studio Community 2022. - Follow the instructions here
- Open
- To build from the command line
- Open a
Developer Command Prompt for VS 2022as an administrator and change directory to your build directory. - Run
build.bat- By default, this generates the debug appxbundle targeting both x64 and ARM64
- To only target Debug|x64, run
build.bat x64 - To only target Debug|ARM64 run
build.bat ARM64 - To build Releases instead of Debug appxbundles, include the
reloption (e.g.build.bat rel,build.bat rel x64) - For a clean build, include the
cleanoption (e.g.build.bat clean,build.bat clean rel ARM64)
- Open a
- For a UI guided build
-
If everything has gone correctly, you should find your app package in a subfolder under the
AppPackages\DistroLauncher-Appxfolder.- First, install the certificate:
- Double-click on the security certificate file.
- Click the "Install Certificate" button.
- Select "Local Machine" for the store location.
- Select "Automatically select the certificate store based on the type of certificate", then click Next. (If you have any certificate issues, try specifying the Root Certificate Authority Trust here.)
- Proceed through the rest of the wizard, clicking Next, Finish, OK, and then OK.
- Once that's done, you should be able to double-click on the .appxbundle package file and install it.
- First, install the certificate:
The launcher app provides the following functionality:
-
pengwin.exe- Launches the user's default shell in the user's home directory.
-
pengwin.exe install [--root]- Install the distribution and do not launch the shell when complete.
--root: Do not create a user account and leave the default user set to root.
- Install the distribution and do not launch the shell when complete.
-
pengwin.exe run <command line>- Run the provided command line in the current working directory. If no command line is provided, the default shell is launched.
- Everything after
runis passed to WslLaunchInteractive.
-
pengwin.exe config [setting [value]]- Configure settings for this distribution.
- Settings:
--default-user <username>: Sets the default user to . This must be an existing user.
-
pengwin.exe help- Print usage information.