-
Suggestion
-
Resolution: Invalid
-
Not Evaluated
-
None
-
None
-
None
I am trying to install windows service application via qt installer. The install is working only if the windows service is not already installed and not already running in the system – otherwise I will get the error from within the QT installer, when I uninstall the windows service just by removing my windows service TargetDir directory but without stopping and removing my windows service from the list of windows services.
I tried with below installscript.qs and controlScript.qs to execute the stop and remove commands when uninstalling my windows service from the QT installer? but did not work.
How to stop and remove the windows service while uninstalling from QT installer?
function Component() { } Component.prototype.createOperations = function() { component.createOperations(); if (systemInfo.productType === "windows") { if (component.isInstalled() || component.uninstallationRequested()) { component.addElevatedOperation("Execute", "@TargetDir@/platform/tools/Server/TestServer.exe", "stop"); component.addElevatedOperation("Execute", "@TargetDir@/platform/tools/Server/TestServer.exe", "remove"); } component.addElevatedOperation("Execute", "@TargetDir@/platform/tools/Server/TestServer.exe", "install"); component.addElevatedOperation("Execute", "@TargetDir@/platform/tools/Server/TestServer.exe", "start"); } }
config/controlScript.qs
function Controller() { installer.uninstallationStarted.connect(onUninstallationStarted); } onUninstallationStarted = function() { installer.performOperation("Execute", "@TargetDir@/platform/tools/Server/TestServer.exe", "stop"); }