我无法定制卸载过程,但我可以在某种程度上成功定制安装过程。当我注册“installationFinished”信号时,我会调用installscript.qs中的函数,但令人惊讶的是,如果我注册了一些函数,则“uninstallationStarted和uninstallationFinished”信号永远不会被调用。不知道为什么?同样在qinstaller.h中,我们有以下代码来识别不同的安装状态/阶段,但是如何获取类似的信息以进行卸载?
enum Status {
InstallerUnfinished,
InstallerCanceledByUser,
InstallerRunning,
InstallerFailed,
InstallerSucceeded,
};
int status() const;
enum WizardPage {
Introduction = 0x1000,
TargetDirectory = 0x2000,
ComponentSelection = 0x3000,
LicenseCheck = 0x4000,
StartMenuSelection = 0x5000,
ReadyForInstallation = 0x6000,
PerformInstallation = 0x7000,
InstallationFinished = 0x8000,
End = 0xffff
};
答案 0 :(得分:-2)
你试过这个吗?
function Controller()
{
installer.uninstallationStarted.connect(this, Controller.prototype.runMyFunc);
}
Controller.prototype.runMyFunc = function()
{
// your code here
}