当前位置:编程学习 > C#/ASP.NET >>

msi卸载问题

<?xml version='1.0'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
   <Product Id='12345678-1234-1234-1234-123456789012' Name='Test Package' Language='1033'
            Version='1.0.0.0' Manufacturer='Microsoft Corporation'>
      <Package Id='22345678-1234-1234-1234-123456789012'
                Description='My first Windows Installer package based on InstallUtil.exe'
                Comments='This is my first attempt at creating a Windows Installer database'
                Manufacturer='Microsoft Corporation' InstallerVersion='200' Compressed='yes' />
 

      <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
 
      <Directory Id='SourceDir' Name='SourceDir'>
         <Directory Id='ProgramFilesFolder' Name='PFDir'>
            <Directory Id='TestDir' Name='TestDir' LongName='Test Program'>
               <Component Id='MyComponent' Guid='12345678-1234-1234-1234-123456789012'>
                   <File Id='CFG' Name='Cfg.ini' LongName="ClientNetCfg.ini" DiskId='1' 

src='USSEClientNetCfg.ini' />
                  </Component>
                      <Component Id='Manual' Guid='12345678-1234-1234-1234-123456789012'>
                          <File Id='CLIENT' Name='client.exe' LongName="client_Setup.exe" DiskId='1' 

src='client_Setup.exe' />
                      </Component>
   </Directory>
         </Directory>
      </Directory>
 
      <Feature Id='MyFeature' Title='My 1st Feature' Level='1'>
         <ComponentRef Id='MyComponent' />
         <ComponentRef Id='Manual' />
      </Feature>  



      <InstallExecuteSequence>
         <RemoveExistingProducts   After="InstallFinalize"/>
         <Custom Action='ManagedInstall' After='InstallFinalize'>Not Installed</Custom>
         <Custom Action='ManagedUninstall' After='InstallFinalize'>Installed</Custom>
      </InstallExecuteSequence>
 
      <CustomAction Id="ManagedInstall"
           Directory='TestDir'
            ExeCommand='"[ProgramFilesFolder]\Test Program\client_Setup.exe"'
            Return='check'>
      </CustomAction>

      <CustomAction Id="ManagedUninstall"
           Directory='TestDir'
           ExeCommand='"[WindowsFolder]\system32\uscuninstall.exe"'
   Return='check'>
      </CustomAction>

   </Product>
</Wix> --------------------编程问答-------------------- 补充一下:我主要是想用msi文件调用外部的exe文件,我的脚本如上,我在安装的时候没有问题,卸载的时候,控制面板的“Test Package”卸载不了,是不是我的脚本哪里出问题了? --------------------编程问答-------------------- 应该是uscuninstall.exe文件安装时没见拷贝,卸载时找不到,CustomAction失败导致无法卸载的吧。

<CustomAction Id="ManagedUninstall" 
           Directory='TestDir' 
           ExeCommand='"[WindowsFolder]\system32\uscuninstall.exe"' 
   Return='check'> 
       </CustomAction> 
--------------------编程问答-------------------- 我都是在界面直接输入相关参数做的,进步中 --------------------编程问答-------------------- 卸载的时候

<CustomAction Id="ManagedUninstall"  
           Directory='TestDir'  
           ExeCommand='"[WindowsFolder]\system32\uscuninstall.exe"'  
   Return='check'>   
        </CustomAction>
可以执行的到,就是test package在控制面板里卸载不掉,导致第二次安装失败 --------------------编程问答-------------------- 可以参考
http://www.cnblogs.com/downmoon/archive/2007/12/29/1019924.html
http://blog.csdn.net/downmoon/archive/2007/04/24/1581113.aspx
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,