2014-03-12 81 views
1

雖然我可以在某種程度上定製安裝過程,但我無法控制自定義卸載過程。當我註冊信號「installationFinished」時,我的函數會在installscript.qs中被調用,但令人驚訝的是,如果我註冊了一些函數,「uninstallationStarted和uninstallationFinished」的信號永遠不會被調用。不知道爲什麼?同樣在qinstaller.h中,我們有下面的代碼來識別安裝的不同狀態/階段,但是如何獲得類似的卸載信息?Qt安裝程序框架 - 自定義UNINSTALLER

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 
}; 

回答

-2

你試過這個嗎?

function Controller() 
{ 
    installer.uninstallationStarted.connect(this, Controller.prototype.runMyFunc); 
} 

Controller.prototype.runMyFunc = function() 
{ 
// your code here 
}