Uninstallation failed from Apps -> Installed Aps in Windows 11
-
Hello,
I'm writing an installed application for a Qt application.
The Qt version I use is 6.7.2.
The Qt installation framework is 4.8.Here's my config.xml.
It's set up for the application to be installed C:\Program Files.<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Company Product</Name>
<Version>1.0.0</Version>
<Title>Company Product Installed</Title>
<Publisher>Company</Publisher>
<StartMenuDir>Company\Product</StartMenuDir>
<TargetDir>@ApplicationsDir@/@Publisher@/Product</TargetDir>
</Installer>A package.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<Package>
<DisplayName>Company Product</DisplayName>
<Description>This installs Company Product.</Description>
<Version>1.0.0</Version>
<ReleaseDate>2024-09-17</ReleaseDate>
<Default>script</Default>
<Script>installscript.qs</Script>
</Package>And an installscript.qs file.
*function Component() {}
Component.prototype.createOperations = function()
{
component.createOperations();if (systemInfo.productType === "windows") { var targetDir = installer.value("TargetDir"); var startMenuDir = installer.value("StartMenuDir"); component.addOperation("CreateShortcut", targetDir + "/company_program.exe", startMenuDir + "/Company Program.lnk", "iconPath=" + targetDir + "/company_program.ico"); component.addOperation("CreateShortcut", targetDir + "/maintenancetool.exe", startMenuDir + "/Uninstall Company Program.lnk"); }
}*
The problems I have right now are:
- The applications shortcuts are installed for the current user.
- The registry for uninstaller are written HKCU not HKLM.
Removing the application works from its shortcuts in the Start menu, from a console and from the Windows explorer.
But it doesn't when running the Apps > Installed Aps in Windows 11.
When trying from there, there's a Windows that popups very quicky and nothing is uninstalled.So I believe may come from user rights:
- The application is installed under C:\Program Files.
- Shortcut menu are installed for the current user.
- Registries for uninstalling are defined in HKCU.
So I'ld like to have:
- Application is installed under C:\Program Files.
- Shortcut menu installed for all users.
- Registries for uninstalling defined in HKLM.
How can I perform this setup?
Thanks.