我使用 qt 安装程序框架创建了一个应用程序。现在卸载我的应用程序不会删除 AppData/Roaming/My app 文件夹。所以我尝试了我的自定义代码进行卸载以清除我的 AppData。但这使我的安装程序没有响应。
Controller.prototype.FinishedPageCallback = function() {
if (installer.isUninstaller() && installer.status == QInstaller.Success)
{
var appDataPath = QDesktopServices.storageLocation(QDesktopServices.AppDataLocation) + "\\My app";
if(installer.fileExists(appDataPath) === true)
{
installer.executeDetached("cmd",["/c", "rd", "/q", "/s", appDataPath]);
}
gui.clickButton(buttons.FinishButton);
}
}
我也尝试过使用
if(installer.runUninstall === true)
{
installer.performOperation("Execute" , "cmd" "C:/Users/%USERNAME%/AppData/Roaming/My App", "rd", "/s", "/q");
}
也不行。我错过了什么吗?