2017-10-13 22 views
1

제 아이디어는 .msi 설치 파일로 제거 파일을 만듭니다. 여기에 제거 자 단축키를 만드는 방법에 대한 정보를 읽었습니다. http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/create_uninstall_shortcut.html하지만 msi 빌드 후 파일을 제거하는 방법에 대한 정보를 찾을 수 없습니다. 가능한 경우 어떻게 할 수 있습니까? 아니면 cmd 스크립트로 할 수 있을까요? mashine에서 자동으로 내 프로그램을 제거하기위한 스크립트 만 작성하면됩니다. 내 코드는 다음과 같습니다 당신은 시작 메뉴에서 제거 바로 가기를 넣어 안된다 일반적으로Wix는 자동 제거 파일을 만듭니다.

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"><?define WpfApp1_TargetDir=$(var.WpfApp1.TargetDir)?> 
    <Product Id="*" Name="SetupProject2" Language="1033" Version="1.0.0.0" Manufacturer="Andrejka" UpgradeCode="PUT-GUID-HERE"> 
     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

    <Property Id="WIXUI_INSTALLDIR" Value="TESTFILEPRODUCTDIR" /> 
    <Property Id="WixShellExecTarget" Value="[#WpfApp1.exe]" /> 
    <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" /> 
    <Property Id="LAUNCH_APP_ON_EXIT" Value="1" /> 

    <InstallExecuteSequence> 
    <Custom Action='LaunchApplication' After='InstallFiles'/> 
    </InstallExecuteSequence> 
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" /> 

     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
     <MediaTemplate EmbedCab="yes"/> 
     <Feature Id="ProductFeature" Title="SetupProject2" Level="1"> 
      <ComponentGroupRef Id="ProductComponents" /> 
     </Feature> 
    </Product> 

    <Fragment> 
     <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="TESTFILEPRODUCTDIR" Name="SetupProject2"> 
      <Directory Id="ProgramFilesFolder"> 
       <Directory Id="INSTALLFOLDER" Name="SetupProject2" />  
     </Directory> 
      </Directory> 
     </Directory> 
    </Fragment> 

    <Fragment> 
     <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
      <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> 
      <!-- <Component Id="ProductComponent"> --> 
       <!-- TODO: Insert files, registry keys, and other resources here. --> 
      <!-- </Component> --> 

      <Component Id="WpfApp1.exe" Guid="*"> 
       <File Id="WpfApp1.exe" Name="WpfApp1.exe" Source="$(var.WpfApp1_TargetDir)WpfApp1.exe" />  
      </Component> 
      <Component Id="WpfApp1.exe.config" Guid="*"> 
       <File Id="WpfApp1.exe.config" Name="WpfApp1.exe.config" Source="$(var.WpfApp1_TargetDir)WpfApp1.exe.config" /> 
      </Component> 
      <Component Id="aws_sdk_net_core_support.dll" Guid="*"> 
       <File Id="aws_sdk_net_core_support.dll" Name="aws-sdk-net-core-support.dll" Source="$(var.WpfApp1_TargetDir)aws-sdk-net-core-support.dll" /> 
      </Component> 
      <Component Id="AWSSDK.Core.dll" Guid="*"> 
       <File Id="AWSSDK.Core.dll" Name="AWSSDK.Core.dll" Source="$(var.WpfApp1_TargetDir)AWSSDK.Core.dll" /> 
      </Component> 
      <Component Id="AWSSDK.SimpleNotificationService.dll" Guid="*"> 
       <File Id="AWSSDK.SimpleNotificationService.dll" Name="AWSSDK.SimpleNotificationService.dll" Source="$(var.WpfApp1_TargetDir)AWSSDK.SimpleNotificationService.dll" /> 
      </Component> 
      <Component Id="MimeSharp.dll" Guid="*"> 
       <File Id="MimeSharp.dll" Name="MimeSharp.dll" Source="$(var.WpfApp1_TargetDir)MimeSharp.dll" /> 
      </Component> 
     </ComponentGroup> 
    </Fragment> 
</Wix> 
+0

Welcome to stackoverflow - 질문을 이해하는 데 다소 시간이 걸렸지 만, 필요한 것을 얻은 것 같아서 기쁩니다. 소스에 GUID를 게시하지 마십시오. 사람들이 GUID를 복사 할 수 있으며 더 이상 고유하지 않습니다 (GUID의 모든 목적을 충족하지 못함). 이것은 매우 중요합니다. 아직 거주하고 있지 않다면 새로운 구성 요소 GUID를 생성하거나 더 나은 방법으로 ** 구성 요소 GUID 자동 계산 **을 설정하는 개념을 사용합니다. WiX 소스를 단순화 할 수도 있습니다 (https://stackoverflow.com/questions/24732761/syntax-for-guids-in-wix/24769965#24769965). –

+0

Im 여기, 답변 주셔서 감사합니다 – Andrej

+0

설치 프로그램과 제거 프로그램은 msiexec (Windows Installer)입니다. msi 파일은 데이터베이스이며, WiX는이를 구축하기위한 도구입니다. –

답변

0

, 그것은 사실 내가 믿는 Windows 응용 프로그램에 대한 마이크로 소프트의 로고 요구 사항의 위반입니다. 오히려 사람들은 프로그램 추가/제거 애플릿을 통해 정상적인 방법으로 제품을 설치 제거해야합니다.

UPDATE는 : - 항상 자동으로 사용할 수 단지 그래서, 제거 분명하다 A가 내장 된 MSI 파일의 기능입니다, 또한 Shortcuts with name "Uninstall <Program Name>" are not displayed in Windows 8/8.1/10

: 나는이 주제에 대한 좀 더 많은 정보와 함께이 대답을 발견 적극적으로 차단되지 않은 경우 (예 : 일부 프로그램이 프로그램 추가/제거에서 숨어 있음). 제대로 제거를 지원하기 위해 WiX 소스에서해야 할 추가 작업은 없습니다. Windows Installer 지침을 따르면 "무료"로 제공됩니다. Uninstalling an MSI file from the command line without using msiexec :

당신이 요구하는 것은 제거 배치 파일을 만들 수있는 방법을 경우

, 당신이 "제거 참조"에서 MSI 파일을 제거하는 방법의 과다를 찾을 수 있습니다.

요약하면 MSI의 제품 코드가있는 경우 아래 명령 줄을 실행하면됩니다 (여기에 설명 된대로 시스템을 쿼리하여 제품 코드를 찾을 수 있습니다 : How can I find the product GUID of an installed MSI setup?).

msiexec.exe /x {your-product-guid} 

를하거나 같이 원래 MSI 설치 파일을 참조하여 제거 :) 제품 코드를 자동으로 생성 더 많은에 대한

msiexec.exe /x "c:\filename.msi 

이 제거 참조 (위의 링크 된 답변을 참조하십시오) 이것에 대한 정보.