Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Build parameters:
- `cmake . -DBUILD_BUNDLE=TRUE` - Build bundle msix package (requires ARM64 built first)

### Deploying WSL (Windows Only)
- Install MSI: `bin\<platform>\<target>\wsl.msi`
- Install MSI: `bin\<platform>\<target>\wsl.msi` and `bin\<platform>\<target>\wsla.msi`
- OR use script: `powershell tools\deploy\deploy-to-host.ps1`
- For Hyper-V VM: `powershell tools\deploy\deploy-to-vm.ps1 -VmName <vm> -Username <user> -Password <pass>`

Expand Down
3 changes: 3 additions & 0 deletions .pipelines/build-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ parameters:
pattern: "gluepackage.msix"
- target: "msipackage"
pattern: "wsl.msi"
- target: "wslamsi"
pattern: "wsla.msi"

- name: platforms
type: object
Expand Down Expand Up @@ -267,6 +269,7 @@ stages:
New-Item -ItemType Directory -Path "$(ob_outputDirectory)\bundle" -Force
$arch = '${{ platform }}'
Copy-Item -Path "bin\$arch\release\wsl.msi" -Destination "$(ob_outputDirectory)\bundle\wsl.$(version.WSL_PACKAGE_VERSION).$arch.msi"
Copy-Item -Path "bin\$arch\release\wsla.msi" -Destination "$(ob_outputDirectory)\bundle\wsla.$(version.WSLA_PACKAGE_VERSION).$arch.msi"

- ${{ if eq(parameters.isRelease, 'true') }}:
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ add_subdirectory(nuget)
add_subdirectory(msixgluepackage)
add_subdirectory(msipackage)
add_subdirectory(msixinstaller)
add_subdirectory(wslamsi)
add_subdirectory(src/windows/common)
add_subdirectory(src/windows/service)
add_subdirectory(src/windows/wslaservice)
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/dev-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Note: To build and deploy faster during development, see options in `UserConfig.

## Deploying WSL

Once the build is complete, you can install WSL by installing the MSI package found under `bin\<platform>\<target>\wsl.msi`, or by running `powershell tools\deploy\deploy-to-host.ps1`.
Once the build is complete, you can install WSL by installing the MSI package found under `bin\<platform>\<target>\` (`wsl.msi` and `wsla.msi`), or by running `powershell tools\deploy\deploy-to-host.ps1`.

To deploy on a Hyper-V virtual machine, you can use `powershell tools\deploy\deploy-to-vm.ps1 -VmName <vm> -Username <username> -Password <password>`

Expand Down
6 changes: 3 additions & 3 deletions msipackage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(OUTPUT_PACKAGE ${BIN}/wsl.msi)
set(PACKAGE_WIX_IN ${CMAKE_CURRENT_LIST_DIR}/package.wix.in)
set(PACKAGE_WIX ${BIN}/package.wix)
set(CAB_CACHE ${BIN}/cab)
set(WINDOWS_BINARIES wsl.exe;wslg.exe;wslhost.exe;wslrelay.exe;wslservice.exe;wslserviceproxystub.dll;wslinstall.dll;wslaservice.exe;wsladiag.exe)
set(WINDOWS_BINARIES wsl.exe;wslg.exe;wslhost.exe;wslrelay.exe;wslservice.exe;wslserviceproxystub.dll;wslinstall.dll)
if (WSL_BUILD_WSL_SETTINGS)
list(APPEND WINDOWS_BINARIES "wslsettings/wslsettings.dll;wslsettings/wslsettings.exe;libwsl.dll")
endif()
Expand Down Expand Up @@ -52,7 +52,7 @@ add_custom_command(

add_custom_target(msipackage DEPENDS ${OUTPUT_PACKAGE})
set_target_properties(msipackage PROPERTIES EXCLUDE_FROM_ALL FALSE SOURCES ${PACKAGE_WIX_IN})
add_dependencies(msipackage wsl wslg wslservice wslhost wslrelay wslserviceproxystub init initramfs wslinstall msixgluepackage wslaservice wslaserviceproxystub wsladiag)
add_dependencies(msipackage wsl wslg wslservice wslhost wslrelay wslserviceproxystub init initramfs wslinstall msixgluepackage)

if (WSL_BUILD_WSL_SETTINGS)
add_dependencies(msipackage wslsettings libwsl)
Expand All @@ -66,5 +66,5 @@ if (DEFINED WSL_POST_BUILD_COMMAND)
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
USES_TERMINAL
COMMAND ${WSL_POST_BUILD_COMMAND} -Platform ${TARGET_PLATFORM} -BuildType ${CMAKE_BUILD_TYPE})
COMMAND ${WSL_POST_BUILD_COMMAND} -Package wsl -Platform ${TARGET_PLATFORM} -BuildType ${CMAKE_BUILD_TYPE})
endif()
181 changes: 4 additions & 177 deletions msipackage/package.wix.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
</File>

<File Id="wslg.exe" Name="wslg.exe" Source="${PACKAGE_INPUT_DIR}/wslg.exe" />
<File Id="wsladiag.exe" Name="wsladiag.exe" Source="${PACKAGE_INPUT_DIR}/wsladiag.exe" />
<File Id="wslhost.exe" Name="wslhost.exe" Source="${PACKAGE_INPUT_DIR}/wslhost.exe" />
<File Id="wslrelay.exe" Name="wslrelay.exe" Source="${PACKAGE_INPUT_DIR}/wslrelay.exe" />
<File Id="wslserviceproxystub.dll" Name="wslserviceproxystub.dll" Source="${PACKAGE_INPUT_DIR}/wslserviceproxystub.dll" />
Expand All @@ -41,12 +40,6 @@
<File Id="system.vhd" Source="${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/system.vhd"/>
<?endif?>


<!-- Temporary runtime VHD. TODO: Update once the final VHD is available. -->
<?if "${WSL_DEV_BINARY_PATH}" = "" AND "${TARGET_PLATFORM}" = "x64" ?>
<File Id="wslarootfs.vhd" Name="wslarootfs.vhd" Source="${WSLA_TEST_DISTRO_SOURCE_DIR}/rootfs.vhd"/>
<?endif?>

<!-- Installation folder -->
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\MSI">
<RegistryValue Name="InstallLocation" Value="[INSTALLDIR]" Type="string" />
Expand Down Expand Up @@ -235,176 +228,11 @@
<ServiceInstall Name="WSLService" DisplayName="WSL Service" Description="WSL Service" Start="auto" Type="ownProcess" ErrorControl="normal" Account="LocalSystem" Vital="yes" Interactive="no" />

<!-- The service is stopped on uninstall and upgrade.
N.B. It shouldn't be started on install because it will fail to start if the OC is missing,
N.B. It shouldn't be started on install because it will fail to start if the OC is missing,
which would fail the install. -->
<ServiceControl Id="StopService" Stop="both" Remove="uninstall" Name="WSLService" Wait="yes" />
</Component>

<Component Id="wslaservice" Guid="DC97520E-BFA5-4559-960F-D580E151629F" UninstallWhenSuperseded="yes" DisableRegistryReflection="yes" Bitness="always64">
<!-- WSLAServiceProxyStub. -->
<RegistryKey Root="HKCR" Key="CLSID\{4EA0C6DD-E9FF-48E7-994E-13A31D10DC61}">
<RegistryValue Value="PSFactoryBuffer" Type="string" />
<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wslaserviceproxystub.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Both" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- WSLAService COM app -->
<RegistryKey Root="HKCR" Key="AppID\{E9B79997-57E3-4201-AECC-6A464E530DD2}">

<!-- O:BAG:BAD:(A;;CCDCSW;;;AU)(A;;CCDCSW;;;PS)(A;;CCDCSW;;;SY) -->
<RegistryValue Name="AccessPermission" Value="01000480580000006800000000000000140000000200440003000000000014000B00000001010000000000050B000000000014000B00000001010000000000050A000000000014000B0000000101000000000005120000000102000000000005200000002002000001020000000000052000000020020000" Type="binary" />
<RegistryValue Name="LaunchPermission" Value="01000480580000006800000000000000140000000200440003000000000014000B00000001010000000000050B000000000014000B00000001010000000000050A000000000014000B0000000101000000000005120000000102000000000005200000002002000001020000000000052000000020020000" Type="binary" />
<RegistryValue Name="LocalService" Value="WSLAService" Type="string" />
</RegistryKey>

<!-- WSLAContainer -->
<RegistryKey Root="HKCR" Key="CLSID\{B1F1C4E3-C225-4CAE-AD8A-34C004DE1AE4}">
<RegistryValue Name="AppId" Value="{E9B79997-57E3-4201-AECC-6A464E530DD2}" Type="string" />
<RegistryValue Value="WSLAContainer" Type="string" />
</RegistryKey>

<!-- WSLAProcess -->
<RegistryKey Root="HKCR" Key="CLSID\{AFBEA6D6-D8A4-4F81-8FED-F947EB74B33B}">
<RegistryValue Name="AppId" Value="{E9B79997-57E3-4201-AECC-6A464E530DD2}" Type="string" />
<RegistryValue Value="WSLAProcess" Type="string" />
</RegistryKey>

<!-- WSLAUserSession -->
<RegistryKey Root="HKCR" Key="CLSID\{a9b7a1b9-0671-405c-95f1-e0612cb4ce8f}">
<RegistryValue Name="AppId" Value="{E9B79997-57E3-4201-AECC-6A464E530DD2}" Type="string" />
<RegistryValue Value="WSLAUserSession" Type="string" />
</RegistryKey>

<!-- WSLAVirtualMachine -->
<RegistryKey Root="HKCR" Key="CLSID\{0CFC5DC1-B6A7-45FC-8034-3FA9ED73CE30}">
<RegistryValue Name="AppId" Value="{E9B79997-57E3-4201-AECC-6A464E530DD2}" Type="string" />
<RegistryValue Value="WSLAVirtualMachine" Type="string" />
</RegistryKey>
<!-- WSLASession -->
<RegistryKey Root="HKCR" Key="CLSID\{4877FEFC-4977-4929-A958-9F36AA1892A4}">
<RegistryValue Name="AppId" Value="{E9B79997-57E3-4201-AECC-6A464E530DD2}" Type="string" />
<RegistryValue Value="WSLASession" Type="string" />
</RegistryKey>

<!-- IWSLAUserSession-->
<RegistryKey Root="HKCR" Key="Interface\{82A7ABC8-6B50-43FC-AB96-15FBBE7E8760}">
<RegistryValue Value="IWSLAUserSession" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC61}" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- IWSLAVirtualMachine-->
<RegistryKey Root="HKCR" Key="Interface\{82A7ABC8-6B50-43FC-AB96-15FBBE7E8761}">
<RegistryValue Value="IWSLAVirtualMachine" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC61}" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- IWSLAContainer-->
<RegistryKey Root="HKCR" Key="Interface\{7577FE8D-DE85-471E-B870-11669986F332}">
<RegistryValue Value="IWSLAContainer" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC61}" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- IWSLAProcess-->
<RegistryKey Root="HKCR" Key="Interface\{1AD163CD-393D-4B33-83A2-8A3F3F23E608}">
<RegistryValue Value="IWSLAProcess" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC61}" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- ITerminationCallback-->
<RegistryKey Root="HKCR" Key="Interface\{7BC4E198-6531-4FA6-ADE2-5EF3D2A04DFE}">
<RegistryValue Value="ITerminationCallback" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC61}" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- IProgressCallback-->
<RegistryKey Root="HKCR" Key="Interface\{5038842F-53DB-4F30-A6D0-A41B02C94AC1}">
<RegistryValue Value="IProgressCallback" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC61}" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- IWSLASession-->
<RegistryKey Root="HKCR" Key="Interface\{EF0661E4-6364-40EA-B433-E2FDF11F3519}">
<RegistryValue Value="IWSLASession" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC61}" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- wsldevicehost.dll -->
<!-- TODO: WSL currently has two AppID registrations for wsldevicehost, is that needed? -->
<RegistryKey Root="HKCR" Key="AppID\{C457EA11-5486-4174-B90D-089909EDB170}">
<RegistryValue Name="DllSurrogate" Value="" Type="string" />
<RegistryValue Name="AppIDFlags" Value="2048" Type="integer" />

<!-- O:BAG:BAD:(A;;CCDCSW;;;AU)(A;;CCDCSW;;;PS)(A;;CCDCSW;;;SY) -->
<RegistryValue Name="AccessPermission" Value="01000480580000006800000000000000140000000200440003000000000014000B00000001010000000000050B000000000014000B00000001010000000000050A000000000014000B0000000101000000000005120000000102000000000005200000002002000001020000000000052000000020020000" Type="binary" />
<RegistryValue Name="LaunchPermission" Value="01000480580000006800000000000000140000000200440003000000000014000B00000001010000000000050B000000000014000B00000001010000000000050A000000000014000B0000000101000000000005120000000102000000000005200000002002000001020000000000052000000020020000" Type="binary" />
</RegistryKey>

<!-- WslDeviceHost WSLA_VIRTIO_FS_ADMIN_CLASS_ID -->
<RegistryKey Root="HKCR" Key="CLSID\{8F7C2A3B-D9E4-4C1F-A2B8-5E3D7C9F1A6E}">
<RegistryValue Value="WslDeviceHost_VirtioFsAdmin" Type="string" />
<RegistryValue Name="AppId" Value="{C457EA11-5486-4174-B90D-089909EDB170}" Type="string" />

<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wsldevicehost.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Both" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- WslDeviceHost WSLA_VIRTIO_FS_CLASS_ID -->
<RegistryKey Root="HKCR" Key="CLSID\{06ED032F-C528-41C1-B75D-905EEE823BBA}">
<RegistryValue Value="WslDeviceHost_VirtioFs" Type="string" />
<RegistryValue Name="AppId" Value="{C457EA11-5486-4174-B90D-089909EDB170}" Type="string" />

<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wsldevicehost.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Both" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- WslDeviceHost WSLA_VIRTIO_NET_CLASS_ID -->
<RegistryKey Root="HKCR" Key="CLSID\{7B3C9A42-8E1F-4D5A-9F2E-C4A7B8D3E6F1}">
<RegistryValue Value="WslDeviceHost_VirtioNet" Type="string" />
<RegistryValue Name="AppId" Value="{C457EA11-5486-4174-B90D-089909EDB170}" Type="string" />

<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wsldevicehost.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Both" Type="string" />
</RegistryKey>
</RegistryKey>

<!-- WslDeviceHost WSLA_VIRTIO_PMEM_CLASS_ID -->
<RegistryKey Root="HKCR" Key="CLSID\{ABB755FC-1B86-4255-83E2-E5787ABCF6C2}">
<RegistryValue Value="WslDeviceHost_VirtioPmem" Type="string" />
<RegistryValue Name="AppId" Value="{C457EA11-5486-4174-B90D-089909EDB170}" Type="string" />

<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wsldevicehost.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Both" Type="string" />
</RegistryKey>
</RegistryKey>

<File Id="wslaservice.exe" Source="${BIN}/wslaservice.exe" KeyPath="yes" />
<File Id="wslaserviceproxystub.dll" Name="wslaserviceproxystub.dll" Source="${BIN}/wslaserviceproxystub.dll" />

<ServiceInstall Name="WSLAService" DisplayName="WSLA Service" Description="WSLA Service" Start="auto" Type="ownProcess" ErrorControl="normal" Account="LocalSystem" Vital="yes" Interactive="no" />
<ServiceControl Id="StopWSLAService" Stop="both" Remove="uninstall" Name="WSLAService" Wait="yes" />
</Component>
<Component Id="wslg" Guid="F0C8D6BA-1502-41E7-BF72-D93DFA134731" UninstallWhenSuperseded="yes" DisableRegistryReflection="yes" Bitness="always64">
<?if "${WSL_DEV_BINARY_PATH}" = "" ?>
<File Id="msrdc.exe" Source="${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/msrdc.exe" />
Expand Down Expand Up @@ -544,7 +372,6 @@
<Feature Id="WSL" Title="Windows Subsystem for Linux" Level="1">
<ComponentRef Id="wsl" />
<ComponentRef Id="wslservice" />
<ComponentRef Id="wslaservice" />
<ComponentRef Id="wslg" />
<ComponentRef Id="tools" />
<ComponentRef Id="explorershell" />
Expand Down Expand Up @@ -672,9 +499,9 @@
Covers cases where:
- The MSI package is installed for the first time and the old MSIX needs to be removed
- The MSI package is uninstalled and the glue MSIX must be removed

Must also run before CreateShortcuts since there might be an old MSIX shortcut that conflicts with ours.
Also, this action must not run during upgrades
Also, this action must not run during upgrades
since upgrades start by first uninstalling the package, this isn't run if UPGRADINGPRODUCTCODE is set in the 'removing' MSI process.
In this path, only the installing MSI process should run this action.

Expand Down Expand Up @@ -725,7 +552,7 @@
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
<Property Id="ARPSYSTEMCOMPONENT" Value="yes" Secure="yes" />

<!-- Setting REINSTALLMODE to AMUS will force all re-installed components to re-install all files, registry keys and shortcuts.
<!-- Setting REINSTALLMODE to AMUS will force all re-installed components to re-install all files, registry keys and shortcuts.
This is useful during downgrades since components with KeyPath set will not removed if their KeyPath points to valid file / registry key.
-->
<Property Id="REINSTALLMODE" Value="AMUS" Secure="yes" />
Expand Down
2 changes: 1 addition & 1 deletion src/windows/wslaclient/DllMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ try
}
};

const auto downloadPath = wsl::windows::common::wslutil::DownloadFileImpl(PackageUrl, L"wsl.msi", callback);
const auto downloadPath = wsl::windows::common::wslutil::DownloadFileImpl(PackageUrl, L"wsla.msi", callback);

auto cleanup = wil::scope_exit_log(WI_DIAGNOSTICS_INFO, [&]() { std::filesystem::remove(downloadPath); });

Expand Down
Loading
Loading