[New Utility]Mouse Without Borders

* Integrate Mouse Without Borders into PowerToys

---------

Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
This commit is contained in:
Andrey Nekrasov
2023-05-15 23:32:26 +01:00
committed by Jaime Bernardo
parent a0b9af039d
commit 29eebe16a4
304 changed files with 37234 additions and 133 deletions

View File

@@ -14,6 +14,7 @@
<?define AlwaysOnTopProjectName="AlwaysOnTop"?>
<?define MeasureToolProjectName="MeasureTool"?>
<?define HostsProjectName="Hosts"?>
<?define MouseWithoutBordersProjectName="MouseWithoutBorders"?>
<?define PastePlainProjectName="PastePlain"?>
<?define RegistryPreviewProjectName="RegistryPreview"?>
<?define PeekProjectName="Peek"?>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:Fire="http://schemas.microsoft.com/wix/FirewallExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include $(sys.CURRENTDIR)\Common.wxi?>
<?define MouseWithoutBordersFiles=?>
<?define MouseWithoutBordersFilesPath=$(var.BinDir)modules\$(var.MouseWithoutBordersProjectName)\?>
<Fragment>
<DirectoryRef Id="MouseWithoutBordersInstallFolder" FileSource="$(var.BinDir)modules\$(var.MouseWithoutBordersProjectName)">
<!-- Generated by generateFileComponents.ps1 -->
<!--MouseWithoutBordersFiles_Component_Def-->
</DirectoryRef>
<ComponentGroup Id="MouseWithoutBordersComponentGroup">
<Component Id="RemoveMouseWithoutBordersFolder" Guid="303F02A7-7E90-486F-8558-BB1A1BEC39E1" Directory="MouseWithoutBordersInstallFolder" >
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="RemoveMouseWithoutBordersFolder" Value="" KeyPath="yes"/>
</RegistryKey>
<RemoveFolder Id="RemoveFolderMouseWithoutBordersFolder" Directory="MouseWithoutBordersInstallFolder" On="uninstall"/>
</Component>
<Component Id="MouseWithoutBordersFirewallComponent" Directory="MouseWithoutBordersInstallFolder" Guid="FEA59459-EC0E-4636-8E76-4C168235982B">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="MouseWithoutBordersFirewall_Component" Value="" KeyPath="yes"/>
</RegistryKey>
<!-- The program name used here will be generated by generateFileComponents.ps1 -->
<Fire:FirewallException Id="MouseWithoutBordersFirewallException1" Name="PowerToys.MouseWithoutBorders" Scope="localSubnet" IgnoreFailure="yes" Program="[#MouseWithoutBordersFiles_File_PowerToys.MouseWithoutBorders.exe]" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@@ -39,6 +39,7 @@ call "..\..\..\publish.cmd" arm64
call move /Y ..\..\..\KeyboardManager.wxs.bk ..\..\..\KeyboardManager.wxs
call move /Y ..\..\..\MeasureTool.wxs.bk ..\..\..\MeasureTool.wxs
call move /Y ..\..\..\MouseUtils.wxs.bk ..\..\..\MouseUtils.wxs
call move /Y ..\..\..\MouseWithoutBorders.wxs.bk ..\..\..\MouseWithoutBorders.wxs
call move /Y ..\..\..\Peek.wxs.bk ..\..\..\Peek.wxs
call move /Y ..\..\..\PowerAccent.wxs.bk ..\..\..\PowerAccent.wxs
call move /Y ..\..\..\PowerRename.wxs.bk ..\..\..\PowerRename.wxs
@@ -123,6 +124,7 @@ call "..\..\..\publish.cmd" arm64
<Compile Include="TextExtractor.wxs" />
<Compile Include="Tools.wxs" />
<Compile Include="VideoConference.wxs" />
<Compile Include="MouseWithoutBorders.wxs" />
<Compile Include="MonacoSRC.wxs" />
@@ -131,6 +133,10 @@ call "..\..\..\publish.cmd" arm64
<Compile Include="WinAppSDK.wxs" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixFirewallExtension">
<HintPath>$(WixExtDir)\WixFirewallExtension.dll</HintPath>
<Name>WixFirewallExtension</Name>
</WixExtension>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>

View File

@@ -76,7 +76,8 @@
<ComponentGroupRef Id="ShortcutGuideComponentGroup" />
<ComponentGroupRef Id="TextExtractorComponentGroup" />
<ComponentGroupRef Id="VideoConferenceComponentGroup" />
<ComponentGroupRef Id="MouseWithoutBordersComponentGroup" />
<ComponentGroupRef Id="ResourcesComponentGroup" />
<ComponentGroupRef Id="WindowsAppSDKComponentGroup" />
<ComponentGroupRef Id="ToolComponentGroup" />
@@ -192,7 +193,10 @@
Installed AND (REMOVE="ALL")
</Custom>
<!-- TODO: Use to activate embedded MSIX -->
<Custom Action="UninstallServicesTask" After="InstallFinalize">
Installed AND (REMOVE="ALL")
</Custom>
<!-- TODO: Use to activate embedded MSIX -->
<!--<Custom Action="UninstallEmbeddedMSIXTask" After="InstallFinalize">
Installed AND (REMOVE="ALL")
</Custom>-->
@@ -330,7 +334,14 @@
DllEntry="UninstallEmbeddedMSIXCA"
/>
<CustomAction Id="TelemetryLogInstallSuccess"
<CustomAction Id="UninstallServicesTask"
Return="ignore"
Impersonate="yes"
BinaryKey="PTCustomActions"
DllEntry="UninstallServicesCA"
/>
<CustomAction Id="TelemetryLogInstallSuccess"
Return="ignore"
Impersonate="yes"
BinaryKey="PTCustomActions"
@@ -529,6 +540,10 @@
</Directory>
</Directory>
<!-- MouseWithoutBorders -->
<Directory Id="MouseWithoutBordersInstallFolder" Name="$(var.MouseWithoutBordersProjectName)">
</Directory>
<!-- Peek -->
<Directory Id="PeekInstallFolder" Name="$(var.PeekProjectName)">
<Directory Id="PeekAssetsFolder" Name="Assets" />
@@ -537,7 +552,7 @@
</Directory>
</Directory>
<!-- Launcher -->
<!-- Launcher -->
<Directory Id="LauncherInstallFolder" Name="launcher">
<Directory Id="LauncherImagesFolder" Name="Images" />

View File

@@ -72,6 +72,10 @@ Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListNa
Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\MouseUtils\MouseJumpUI\PowerToys.MouseJumpUI.deps.json"" -fileListName MouseJumpUIFiles -wxsFilePath $PSScriptRoot\MouseUtils.wxs"
Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""MouseJumpUIFiles"" -wxsFilePath $PSScriptRoot\MouseUtils.wxs -regroot $registryroot"
#MouseWithoutBorders
Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\MouseWithoutBorders\PowerToys.MouseWithoutBorders.deps.json;$PSScriptRoot..\..\..\$platform\Release\modules\MouseWithoutBorders\PowerToys.MouseWithoutBordersHelper.deps.json;$PSScriptRoot..\..\..\$platform\Release\modules\MouseWithoutBorders\PowerToys.MouseWithoutBordersService.deps.json"" -fileListName MouseWithoutBordersFiles -wxsFilePath $PSScriptRoot\MouseWithoutBorders.wxs"
Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""MouseWithoutBordersFiles"" -wxsFilePath $PSScriptRoot\MouseWithoutBorders.wxs -regroot $registryroot"
#MeasureTool
Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\MeasureTool\PowerToys.MeasureToolUI.deps.json"" -fileListName MeasureToolFiles -wxsFilePath $PSScriptRoot\MeasureTool.wxs -isWinAppSdkProj 1"
Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""MeasureToolFiles"" -wxsFilePath $PSScriptRoot\MeasureTool.wxs -regroot $registryroot"

View File

@@ -1,5 +1,6 @@
[CmdletBinding()]
Param(
# Can be multiple files separated by ; as long as they're on the same directory
[Parameter(Mandatory = $True, Position = 1)]
[AllowEmptyString()]
[string]$fileDepsJson,
@@ -56,16 +57,22 @@ $dllsToIgnore = @("System.CodeDom.dll", "WindowsBase.dll")
if ($fileDepsJson -eq [string]::Empty) {
$fileDepsRoot = $depsPath
} else {
$fileDepsRoot = (Get-ChildItem $fileDepsJson).Directory.FullName
$depsJson = Get-Content $fileDepsJson | ConvertFrom-Json
$multipleDepsJson = $fileDepsJson.Split(";")
$runtimeList = ([array]$depsJson.targets.PSObject.Properties)[-1].Value.PSObject.Properties | Where-Object {
$_.Name -match "runtimepack.*Runtime"
};
foreach ( $singleDepsJson in $multipleDepsJson )
{
$runtimeList | ForEach-Object {
$_.Value.PSObject.Properties.Value | ForEach-Object {
$fileExclusionList += $_.PSObject.Properties.Name
$fileDepsRoot = (Get-ChildItem $singleDepsJson).Directory.FullName
$depsJson = Get-Content $singleDepsJson | ConvertFrom-Json
$runtimeList = ([array]$depsJson.targets.PSObject.Properties)[-1].Value.PSObject.Properties | Where-Object {
$_.Name -match "runtimepack.*Runtime"
};
$runtimeList | ForEach-Object {
$_.Value.PSObject.Properties.Value | ForEach-Object {
$fileExclusionList += $_.PSObject.Properties.Name
}
}
}
}

View File

@@ -62,7 +62,7 @@ UINT __stdcall CheckGPOCA(MSIHANDLE hInstall)
LPWSTR currentScope = nullptr;
hr = WcaGetProperty(L"InstallScope", &currentScope);
if(std::wstring{ currentScope } == L"perUser")
if (std::wstring{ currentScope } == L"perUser")
{
if (powertoys_gpo::getDisablePerUserInstallationValue() == powertoys_gpo::gpo_rule_configured_enabled)
{
@@ -202,6 +202,69 @@ LExit:
return WcaFinalize(er);
}
UINT __stdcall RemoveWindowsServiceByName(std::wstring serviceName)
{
SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
if (!hSCManager)
{
return ERROR_INSTALL_FAILURE;
}
SC_HANDLE hService = OpenService(hSCManager, serviceName.c_str(), SERVICE_STOP | DELETE);
if (!hService)
{
CloseServiceHandle(hSCManager);
return ERROR_INSTALL_FAILURE;
}
SERVICE_STATUS ss;
if (ControlService(hService, SERVICE_CONTROL_STOP, &ss))
{
Sleep(1000);
while (QueryServiceStatus(hService, &ss))
{
if (ss.dwCurrentState == SERVICE_STOP_PENDING)
{
Sleep(1000);
}
else
{
break;
}
}
}
BOOL deleteResult = DeleteService(hService);
CloseServiceHandle(hService);
CloseServiceHandle(hSCManager);
if (!deleteResult)
{
return ERROR_INSTALL_FAILURE;
}
return ERROR_SUCCESS;
}
UINT __stdcall UninstallServicesCA(MSIHANDLE hInstall)
{
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
hr = WcaInitialize(hInstall, "CreateScheduledTaskCA");
ExitOnFailure(hr, "Failed to initialize");
hr = RemoveWindowsServiceByName(L"PowerToys.MWB.Service");
LExit:
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
return WcaFinalize(er);
}
// Creates a Scheduled Task to run at logon for the current user.
// The path of the executable to run should be passed as the CustomActionData (Value).
// Based on the Task Scheduler Logon Trigger Example:
@@ -269,10 +332,10 @@ UINT __stdcall CreateScheduledTaskCA(MSIHANDLE hInstall)
// ------------------------------------------------------
// Create an instance of the Task Service.
hr = CoCreateInstance(CLSID_TaskScheduler,
nullptr,
CLSCTX_INPROC_SERVER,
IID_ITaskService,
reinterpret_cast<void**>(&pService));
nullptr,
CLSCTX_INPROC_SERVER,
IID_ITaskService,
reinterpret_cast<void**>(&pService));
ExitOnFailure(hr, "Failed to create an instance of ITaskService: %x", hr);
// Connect to the task service.
@@ -495,10 +558,10 @@ UINT __stdcall RemoveScheduledTasksCA(MSIHANDLE hInstall)
// ------------------------------------------------------
// Create an instance of the Task Service.
hr = CoCreateInstance(CLSID_TaskScheduler,
nullptr,
CLSCTX_INPROC_SERVER,
IID_ITaskService,
reinterpret_cast<void**>(&pService));
nullptr,
CLSCTX_INPROC_SERVER,
IID_ITaskService,
reinterpret_cast<void**>(&pService));
ExitOnFailure(hr, "Failed to create an instance of ITaskService: %x", hr);
// Connect to the task service.
@@ -831,11 +894,11 @@ UINT __stdcall CertifyVirtualCameraDriverCA(MSIHANDLE hInstall)
}
if (!CertAddEncodedCertificateToStore(hCertStore,
X509_ASN_ENCODING,
reinterpret_cast<const BYTE*>(pFileContent),
size,
CERT_STORE_ADD_ALWAYS,
nullptr))
X509_ASN_ENCODING,
reinterpret_cast<const BYTE*>(pFileContent),
size,
CERT_STORE_ADD_ALWAYS,
nullptr))
{
hr = GetLastError();
ExitOnFailure(hr, "Adding certificate failed", hr);
@@ -1071,6 +1134,7 @@ const std::wstring PTInteropConsumers[] =
L"modules\\Hosts",
L"modules\\Peek",
L"modules\\FileExplorerPreview",
L"modules\\MouseWithoutBorders",
L"modules\\MouseUtils\\MouseJumpUI",
L"modules\\RegistryPreview",
};
@@ -1090,12 +1154,12 @@ UINT __stdcall CreatePTInteropHardlinksCA(MSIHANDLE hInstall)
interopFilesSrcDir = installationFolder + L"dll\\Interop\\";
for (auto file : powerToysInteropFiles)
{
{
for (auto consumer : PTInteropConsumers)
{
std::error_code ec;
std::filesystem::create_hard_link((interopFilesSrcDir + file).c_str(), (installationFolder + consumer + L"\\" + file).c_str(), ec);
if (ec.value() != S_OK)
{
std::wstring errorMessage{ L"Error creating hard link for: " };
@@ -1116,8 +1180,8 @@ UINT __stdcall CreateDotnetRuntimeHardlinksCA(MSIHANDLE hInstall)
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
std::wstring installationFolder, dotnetRuntimeFilesSrcDir, colorPickerDir, powerOCRDir, launcherDir, fancyZonesDir,
imageResizerDir, settingsDir, awakeDir, measureToolDir, powerAccentDir, fileExplorerAddOnsDir, hostsDir, fileLocksmithDir,
mouseJumpDir, registryPreviewDir, peekDir;
imageResizerDir, settingsDir, awakeDir, measureToolDir, powerAccentDir, fileExplorerAddOnsDir, hostsDir, fileLocksmithDir,
mouseJumpDir, registryPreviewDir, peekDir, mwbDir;
hr = WcaInitialize(hInstall, "CreateDotnetRuntimeHardlinksCA");
ExitOnFailure(hr, "Failed to initialize");
@@ -1138,6 +1202,7 @@ UINT __stdcall CreateDotnetRuntimeHardlinksCA(MSIHANDLE hInstall)
fileExplorerAddOnsDir = installationFolder + L"modules\\FileExplorerPreview\\";
hostsDir = installationFolder + L"modules\\Hosts\\";
fileLocksmithDir = installationFolder + L"modules\\FileLocksmith\\";
mwbDir = installationFolder + L"modules\\MouseWithoutBorders\\";
mouseJumpDir = installationFolder + L"modules\\MouseUtils\\MouseJumpUI\\";
registryPreviewDir = installationFolder + L"modules\\RegistryPreview\\";
peekDir = installationFolder + L"modules\\Peek\\";
@@ -1157,6 +1222,7 @@ UINT __stdcall CreateDotnetRuntimeHardlinksCA(MSIHANDLE hInstall)
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fileExplorerAddOnsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (hostsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fileLocksmithDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (mwbDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (mouseJumpDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (registryPreviewDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (peekDir + file).c_str(), ec);
@@ -1173,31 +1239,32 @@ UINT __stdcall CreateDotnetRuntimeHardlinksCA(MSIHANDLE hInstall)
for (auto file : dotnetRuntimeWPFFiles)
{
std::error_code ec;
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (awakeDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (colorPickerDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (powerOCRDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (launcherDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fancyZonesDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (imageResizerDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (powerAccentDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fileExplorerAddOnsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (hostsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (mouseJumpDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (registryPreviewDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (peekDir + file).c_str(), ec);
std::error_code ec;
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (awakeDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (colorPickerDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (powerOCRDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (launcherDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fancyZonesDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (imageResizerDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (powerAccentDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (fileExplorerAddOnsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (hostsDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (mouseJumpDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (registryPreviewDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (peekDir + file).c_str(), ec);
std::filesystem::create_hard_link((dotnetRuntimeFilesSrcDir + file).c_str(), (mwbDir + file).c_str(), ec);
if (ec.value() != S_OK)
{
std::wstring errorMessage{ L"Error creating hard link for: " };
errorMessage += file;
errorMessage += L", error code: " + std::to_wstring(ec.value());
Logger::error(errorMessage);
er = ERROR_INSTALL_FAILURE;
}
if (ec.value() != S_OK)
{
std::wstring errorMessage{ L"Error creating hard link for: " };
errorMessage += file;
errorMessage += L", error code: " + std::to_wstring(ec.value());
Logger::error(errorMessage);
er = ERROR_INSTALL_FAILURE;
}
}
LExit:
LExit:
er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
return WcaFinalize(er);
}
@@ -1280,7 +1347,7 @@ UINT __stdcall DeleteDotnetRuntimeHardlinksCA(MSIHANDLE hInstall)
UINT er = ERROR_SUCCESS;
std::wstring installationFolder, colorPickerDir, powerOCRDir, launcherDir, fancyZonesDir,
imageResizerDir, settingsDir, awakeDir, measureToolDir, powerAccentDir, fileExplorerAddOnsDir,
hostsDir, fileLocksmithDir, mouseJumpDir, registryPreviewDir, peekDir;
hostsDir, fileLocksmithDir, mouseJumpDir, registryPreviewDir, peekDir, mwbDir;
hr = WcaInitialize(hInstall, "DeleteDotnetRuntimeHardlinksCA");
ExitOnFailure(hr, "Failed to initialize");
@@ -1300,6 +1367,7 @@ UINT __stdcall DeleteDotnetRuntimeHardlinksCA(MSIHANDLE hInstall)
fileExplorerAddOnsDir = installationFolder + L"modules\\FileExplorerPreview\\";
hostsDir = installationFolder + L"modules\\Hosts\\";
fileLocksmithDir = installationFolder + L"modules\\FileLocksmith\\";
mwbDir = installationFolder + L"modules\\MouseWithoutBorders\\";
mouseJumpDir = installationFolder + L"modules\\MouseUtils\\MouseJumpUI\\";
registryPreviewDir = installationFolder + L"modules\\RegistryPreview\\";
peekDir = installationFolder + L"modules\\Peek\\";
@@ -1308,37 +1376,39 @@ UINT __stdcall DeleteDotnetRuntimeHardlinksCA(MSIHANDLE hInstall)
{
for (auto file : dotnetRuntimeFiles)
{
DeleteFile((colorPickerDir + file).c_str());
DeleteFile((powerOCRDir + file).c_str());
DeleteFile((launcherDir + file).c_str());
DeleteFile((fancyZonesDir + file).c_str());
DeleteFile((imageResizerDir + file).c_str());
DeleteFile((settingsDir + file).c_str());
DeleteFile((awakeDir + file).c_str());
DeleteFile((measureToolDir + file).c_str());
DeleteFile((powerAccentDir + file).c_str());
DeleteFile((fileExplorerAddOnsDir + file).c_str());
DeleteFile((hostsDir + file).c_str());
DeleteFile((fileLocksmithDir + file).c_str());
DeleteFile((mouseJumpDir + file).c_str());
DeleteFile((registryPreviewDir + file).c_str());
DeleteFile((peekDir + file).c_str());
DeleteFile((colorPickerDir + file).c_str());
DeleteFile((powerOCRDir + file).c_str());
DeleteFile((launcherDir + file).c_str());
DeleteFile((fancyZonesDir + file).c_str());
DeleteFile((imageResizerDir + file).c_str());
DeleteFile((settingsDir + file).c_str());
DeleteFile((awakeDir + file).c_str());
DeleteFile((measureToolDir + file).c_str());
DeleteFile((powerAccentDir + file).c_str());
DeleteFile((fileExplorerAddOnsDir + file).c_str());
DeleteFile((hostsDir + file).c_str());
DeleteFile((fileLocksmithDir + file).c_str());
DeleteFile((mouseJumpDir + file).c_str());
DeleteFile((registryPreviewDir + file).c_str());
DeleteFile((peekDir + file).c_str());
DeleteFile((mwbDir + file).c_str());
}
for (auto file : dotnetRuntimeWPFFiles)
{
DeleteFile((awakeDir + file).c_str());
DeleteFile((colorPickerDir + file).c_str());
DeleteFile((powerOCRDir + file).c_str());
DeleteFile((launcherDir + file).c_str());
DeleteFile((fancyZonesDir + file).c_str());
DeleteFile((imageResizerDir + file).c_str());
DeleteFile((powerAccentDir + file).c_str());
DeleteFile((fileExplorerAddOnsDir + file).c_str());
DeleteFile((hostsDir + file).c_str());
DeleteFile((mouseJumpDir + file).c_str());
DeleteFile((registryPreviewDir + file).c_str());
DeleteFile((peekDir + file).c_str());
DeleteFile((awakeDir + file).c_str());
DeleteFile((colorPickerDir + file).c_str());
DeleteFile((powerOCRDir + file).c_str());
DeleteFile((launcherDir + file).c_str());
DeleteFile((fancyZonesDir + file).c_str());
DeleteFile((imageResizerDir + file).c_str());
DeleteFile((powerAccentDir + file).c_str());
DeleteFile((fileExplorerAddOnsDir + file).c_str());
DeleteFile((hostsDir + file).c_str());
DeleteFile((mouseJumpDir + file).c_str());
DeleteFile((registryPreviewDir + file).c_str());
DeleteFile((peekDir + file).c_str());
DeleteFile((mwbDir + file).c_str());
}
}
catch (std::exception e)
@@ -1372,7 +1442,7 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
}
processes.resize(bytes / sizeof(processes[0]));
std::array<std::wstring_view, 24> processesToTerminate = {
std::array<std::wstring_view, 27> processesToTerminate = {
L"PowerToys.PowerLauncher.exe",
L"PowerToys.Settings.exe",
L"PowerToys.Awake.exe",
@@ -1396,6 +1466,9 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
L"PowerToys.PdfPreviewHandler.exe",
L"PowerToys.SvgPreviewHandler.exe",
L"PowerToys.Peek.UI.exe",
L"PowerToys.MouseWithoutBorders.exe"
L"PowerToys.MouseWithoutBordersHelper.exe"
L"PowerToys.MouseWithoutBordersService.exe"
L"PowerToys.exe",
};
@@ -1462,7 +1535,7 @@ void initSystemLogger()
{
Logger::init("PowerToysMSI", std::wstring{ temp_path } + L"\\PowerToysMSIInstaller", L"");
}
});
});
}
// DllMain - Initialize and cleanup WiX custom action utils.

View File

@@ -27,4 +27,5 @@ EXPORTS
UnApplyModulesRegistryChangeSetsCA
UninstallVirtualCameraDriverCA
UnRegisterContextMenuPackagesCA
UninstallEmbeddedMSIXCA
UninstallEmbeddedMSIXCA
UninstallServicesCA

View File

@@ -61,6 +61,7 @@
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\KeyboardManager.wxs"" ""$(ProjectDir)..\PowerToysSetup\KeyboardManager.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\MeasureTool.wxs"" ""$(ProjectDir)..\PowerToysSetup\MeasureTool.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\MouseUtils.wxs"" ""$(ProjectDir)..\PowerToysSetup\MouseUtils.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\MouseWithoutBorders.wxs"" ""$(ProjectDir)..\PowerToysSetup\MouseWithoutBorders.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Peek.wxs"" ""$(ProjectDir)..\PowerToysSetup\Peek.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\PowerAccent.wxs"" ""$(ProjectDir)..\PowerToysSetup\PowerAccent.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\PowerRename.wxs"" ""$(ProjectDir)..\PowerToysSetup\PowerRename.wxs.bk""""