installer scripting Settings operation
I want to remove windows registry keys using the qt installer framework, while uninstalling?
Does anyone succeeded in removing a settings key from the (registry in windows) using the Settings operation in component script?
component.addOperation("Execute", "cmd /C echo do nothing", "UNDOEXECUTE", "cmd /C @TargetDir@\CleanWindowsRegistry.bat /f");
where CleanWindowsRegistry.bat consists of
[code] reg delete HKEY_CURRENT_USER\Software\SugarTrumpet\player /f [/code]
This works for administrator user but if the uninstaller is used from standard windows user the bat is executed with administrator privileges and does not removes the registry folder.
I think much cleaner, multi-platform, way is to use the Settings operation,
something like [code] component.addOperation("Settings", "HKEY_CURRENT_USER\Software\SugarTrumpet", "remove", "player", "0"); [/code]
But it's not working.
Except the ifw manual, I can't find more detailed information or any example about the operations and possible argument in component scrip?
Everything best, Goran.
finally I found a solution :)
Instead of using the component, in the controller script constructor i connected the "uninstallationStarted" signal:
// default constructor
onUninstallationStarted = function()
installer.performOperation("Execute", "cmd /C reg delete HKEY_CURRENT_USER\Software\SugarTrumpet\player /f");
So the performed operation ("deleting the registry key") is executed at the very beginning of uninstallation process with currently logged user credentials. After that the uninstaller asks for administrators permission and continues the un-installation process as under administrator.
Everything bets, Goran.