Skip to content
Open
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 msipackage/package.wix.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Windows Subsystem for Linux" Language="1033" InstallerVersion="500" Version="${PACKAGE_VERSION}" Manufacturer="Microsoft Corporation" UpgradeCode="6D5B792B-1EDC-4DE9-8EAD-201B820F8E82" Scope="perMachine" Compressed="${COMPRESS_PACKAGE}">
<MajorUpgrade AllowDowngrades="yes" Disallow="no" />
<MajorUpgrade AllowDowngrades="yes" Disallow="no" Schedule="afterInstallInitialize" />
<MediaTemplate EmbedCab="yes" />

<StandardDirectory Id="ProgramFiles64Folder">
Expand Down
30 changes: 30 additions & 0 deletions test/windows/InstallerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,36 @@ class InstallerTests
output);
}

TEST_METHOD(MsiUpgradeRollbackRestoresFiles)
{
// Verify that direct MSI install via msiexec works after uninstall.
// This validates the test infrastructure before testing failure scenarios.
UninstallMsi();
VERIFY_IS_FALSE(IsMsiPackageInstalled());
Comment on lines +697 to +702
Comment on lines +697 to +702

// Re-install the MSI directly via msiexec (same path as CallMsiExec).
PrepareForMsiOperation();
auto logPath = GenerateMsiLogPath();
std::wstring commandLine;
THROW_IF_FAILED(wil::GetSystemDirectoryW(commandLine));
commandLine += std::format(L"\\msiexec.exe /qn /norestart /i \"{}\" /L*V \"{}\"", m_msiPath, logPath);

LogInfo("Calling msiexec: %ls", commandLine.c_str());
Comment on lines +707 to +711

DWORD exitCode = -1;
wsl::shared::retry::RetryWithTimeout<void>(
[&]() {
exitCode = LxsstuRunCommand(commandLine.data());
THROW_HR_IF(E_ABORT, exitCode == ERROR_INSTALL_ALREADY_RUNNING);
},
std::chrono::seconds(1),
std::chrono::minutes(2),
[]() { return wil::ResultFromCaughtException() == E_ABORT; });

VERIFY_ARE_EQUAL(0L, exitCode);
ValidatePackageInstalledProperly();
}

TEST_METHOD(WslUpdateNoNewVersion)
{
constexpr auto endpoint = L"http://127.0.0.1:12345/";
Expand Down