[Interest] QtIFW Delete additional Files when uninstalling

Oliver Niebuhr googleersatz at oliverniebuhr.de
Mon May 1 12:41:49 CEST 2017


Hello.

I am trying to delete additional Files and Folders from the User Home
Directory with no avail.
As the Documentation says that all the Uninstall Stuff must be in the
ControlsScript, I have added / tried the following combinations:

1.) [In the Controller.prototype.IntroductionPageCallback]
var askIfDeleteAdditionalFilesTitle = (qsTr("Delete additional
Application Files?"));

var askIfDeleteAdditionalFilesText = (qsTr("Do you want to remove Files
like Browser Cache and the Application Settings File?\n\nYour Personal
Documents are not affected, as long as they are saved in another
Location!"));

var resultDeleteAdditionalFiles = QMessageBox.warning(
         "askifdeleteadditionalfiles.warning",
 askIfDeleteAdditionalFilesTitle,
askIfDeleteAdditionalFilesText,
QMessageBox.Yes | QMessageBox.No, QMessageBox.No);

if (resultDeleteAdditionalFiles === QMessageBox.Yes) {
checkIfDeleteAdditionalFiles = true;
if(installer.uninstallationStarted())
{
if (systemInfo.kernelType === "winnt") {
checkIfDeleteAdditionalFilesOSKernelType = windows;

//NOTE Remove the QWebEngine Module Cache, Profile, Cookies, Database
etc. from Appdata\\Local\\
installer.performOperation("erase", "@HomeDir@\\AppData\\Local\\Oliver
Niebuhr\\*.*", "/s /f /q")
installer.performOperation("rd", "@HomeDir@\\AppData\\Local\\Oliver
Niebuhr\\", "/s /q")
}

2.) Component.prototype.createOperations = function()
{
try{component.createOperations();

if (installer.isUninstaller() && installer.uninstallationStarted() &&
checkIfDeleteAdditionalFiles === true &&
checkIfDeleteAdditionalFilesOSKernelType === windows)
{//NOTE Remove the QWebEngine Module Cache, Profile, Cookies, Database
etc. from Appdata\\Local\\
component.addOperation("Execute", "erase /s /f /q",
installer.value("HomeDir")+"\\AppData\\Local\\Oliver Niebuhr\\*.*")

component.addOperation("Execute", "rd /s /q",
installer.value("HomeDir")+"\\AppData\\Local\\Oliver Niebuhr\\")
}
    }catch (e){console.log(e);}
}

Its my 2nd week with QtIFW and JavaScript. Thanks for your patience and
any Hint you have for me! :)

Oliver

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170501/9945233c/attachment.sig>


More information about the Interest mailing list