Qt Installer Framework creating multiple entries in Windows Add or Remove Programs
-
Hi guys,
I have a punched together Qt Installer Framework for my Windows App, it all installs fine and overwrites fine when I update the App but it creates a new entry in the Windows Add or remove programs list on every install; I guess it thinks it's installing a clean copy instead of a replacement.
This is my installer script:
var targetDirectoryPage = null; function Component() { installer.gainAdminRights(); component.loaded.connect(this, this.installerLoaded); installer.setDefaultPageVisible(QInstaller.ComponentSelection, false); } Component.prototype.createOperations = function() { component.createOperations(); if (systemInfo.productType === "windows") { component.addOperation("CreateShortcut", "@TargetDir@/sRadioWindows.exe","@AllUsersStartMenuProgramsPath@/sRadio.lnk", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/icon.ico", "iconId=2", "description=sRadio Executable"); } } Component.prototype.installerLoaded = function() { installer.setDefaultPageVisible(QInstaller.TargetDirectory, false); installer.addWizardPage(component, "TargetWidget", QInstaller.TargetDirectory); targetDirectoryPage = gui.pageWidgetByObjectName("DynamicTargetWidget"); targetDirectoryPage.windowTitle = "Choose Installation Directory"; targetDirectoryPage.description.setText("Please select where the sRadio will be installed:"); targetDirectoryPage.targetDirectory.textChanged.connect(this, this.targetDirectoryChanged); targetDirectoryPage.targetDirectory.setText(installer.value("TargetDir")); targetDirectoryPage.targetChooser.released.connect(this, this.targetChooserClicked); gui.pageById(QInstaller.ComponentSelection).entered.connect(this, this.componentSelectionPageEntered); } Component.prototype.targetChooserClicked = function() { var dir = QFileDialog.getExistingDirectory("", targetDirectoryPage.targetDirectory.text); targetDirectoryPage.targetDirectory.setText(dir); } Component.prototype.targetDirectoryChanged = function() { var dir = targetDirectoryPage.targetDirectory.text; if (installer.fileExists(dir) && installer.fileExists(dir + "/maintenancetool.exe")) { targetDirectoryPage.warning.setText("<p style=\"color: red\">Existing installation detected and will be overwritten.</p>"); } else if (installer.fileExists(dir)) { targetDirectoryPage.warning.setText("<p style=\"color: red\">Installing in existing directory. It will be wiped on uninstallation.</p>"); } else { targetDirectoryPage.warning.setText(""); } installer.setValue("TargetDir", dir); } Component.prototype.componentSelectionPageEntered = function() { var dir = installer.value("TargetDir"); if (installer.fileExists(dir) && installer.fileExists(dir + "/maintenancetool.exe")) { installer.execute(dir + "/maintenancetool.exe", "--script=" + dir + "/scripts/auto_uninstall.qs"); } }
Config.xml:
<?xml version="1.0" encoding="UTF-8"?> <Installer> <Name>sRadio</Name> <Version>1.1.0</Version> <Title>sRadio</Title> <Publisher>Allstar Software</Publisher> <MaintenanceToolName>maintenancetool</MaintenanceToolName> <ProductUrl>https://allstarsoftware.co.uk/sradiowindows</ProductUrl> <WizardStyle>Aero</WizardStyle> <!-- <RunProgram>@TargetDir/sRadioWindows.exe</RunProgram>--> <Logo>logo.png</Logo> <SupportsModify>true</SupportsModify> <DisableAuthorizationFallback>true</DisableAuthorizationFallback> <AllowNonAsciiCharacters>true</AllowNonAsciiCharacters> <!-- Directory name is used in component.xml --> <StartMenuDir>sRadio</StartMenuDir> <TargetDir>@ApplicationsDir@/AllstarSoftware/sRadio</TargetDir> <RepositorySettingsPageVisible>false</RepositorySettingsPageVisible> </Installer>
Package.xml:
<?xml version="1.0" encoding="UTF-8"?> <Package> <DisplayName>sRadio</DisplayName> <Description>sRadio SHOUTcast Internet radio client</Description> <Version>1.1.0-0</Version> <ReleaseDate>2021-05-22</ReleaseDate> <Default>true</Default> <Required>true</Required> <Script>installscript.qs</Script> <UserInterfaces> <UserInterface>targetwidget.ui</UserInterface> </UserInterfaces> </Package>
Does anyone know how to prevent it creating a new entry every time?
Thanks.
-
I have the same problem. Did you solve this problem?
-
@Reddevil1310 said in Qt Installer Framework creating multiple entries in Windows Add or Remove Programs:
I have the same problem. Did you solve this problem?
No, I ended up creating my own custom in-App updater that just replaces the files changed where necessary, it's not ideal by any means but it's better than this.