2011-03-18 138 views
2

安裝程序時,它會在安裝完成後立即觸發(通過安裝程序)。但是,當我卸載從控制面板程序,然後試圖打開EXE過,這提供了以下錯誤:卸載問題

Windows cannot find 'MyExe.com'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.

與背景的CMD.EXE。 後,我按OK鍵,會彈出另一個窗口,說:

There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support...

儘管程序被卸載,這些錯誤都是不可取的。

另外,當我安裝較新版本的程序已經存在時,我收到類似的消息,因爲安裝程序試圖先卸載舊版本。

下面是代碼:

.... 

<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" /> 

    <Upgrade Id="D2B0D435-0F86-4D5E-A988-B24215882***"> 
     <UpgradeVersion 
     Minimum="1.0.0.0" Maximum="99.0.0.0" 
     Property="PREVIOUSVERSIONSINSTALLED" 
     IncludeMinimum="yes" IncludeMaximum="no" /> 
     </Upgrade> 

    <CustomAction Id="LaunchApp" Directory="INSTALLDIR" ExeCommand="[SystemFolder]cmd.exe /C start MyExe.exe" /> 

    <InstallExecuteSequence> 
     <RemoveExistingProducts Before="InstallInitialize" /> 
     <Custom Action="LaunchApp" After="InstallFinalize" /> 
    </InstallExecuteSequence> 
    </Product> 
</Wix> 

我想什麼,就是安裝程序會嘗試只在安裝時運行該程序,並在處理卸載什麼也不做。

提前致謝!

回答