2014-09-02 5 views
1

응용 프로그램을 설치할 때 사용자 지정 작업을 수행하려고합니다. 이것은 조용한 모드에서 수행되어야합니다. 따라서 코드의 일부분을 작동하게 만들었습니다.WiX 3.8 CAQuietExec 및 명령 문자열

<?xml version="1.0" 
     encoding="utf-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Fragment> 
     <Property Id="APPFOLDER"> 
      <RegistrySearch Id="PATH" 
        Key="Software\[Manufacturer]\[ProductName]" 
        Root="HKLM" 
        Type="raw" 
        Name="InstallPath" /> 
     </Property> 
     <CustomAction Id="CleanupAppDirCmd" 
         Property="CleanupAppDir" 
         Value='rmdir /s/q "[APPFOLDER]"' 
         Execute="immediate"/> 
     <CustomAction Id="CleanupAppDir" 
         BinaryKey="WixCA" 
         DllEntry="CAQuietExec" 
         Execute="deferred" 
         Return="ignore" 
         Impersonate="no"/> 
     <InstallExecuteSequence> 
      <Custom Action="CleanupAppDirCmd" 
        After="CostFinalize"/> 
      <Custom Action="CleanupAppDir" 
        After="RemoveFiles"> 
       REMOVE="ALL" 
      </Custom> 
     </InstallExecuteSequence> 
    </Fragment> 
</Wix> 

하지만 아무 일도 일어나지 않습니다. 설치 제거를 완료 한 후에도 디렉토리가 존재합니다. 설치 제거 로그는 다음 나에게 말한다 : 나는 CleanupAppDirCmd의 가치에 몇 가지 변화를 시도했지만 아무 일하지

MSI (s) (F8:20) [16:57:15:778]: Executing op: ActionStart(Name=CleanupAppDir,,) MSI (s) (F8:20) [16:57:15:779]: Executing op: CustomActionSchedule(Action=CleanupAppDir,ActionType=3137,Source=BinaryData,Target=CAQuietExec,CustomActionData=rmdir /s/q "C:\Program Files (x86)\Company\") MSI (s) (F8:20) [16:57:15:780]: Creating MSIHANDLE (111) of type 790536 for thread 6176 MSI (s) (F8:C0) [16:57:15:780]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI6D67.tmp, Entrypoint: CAQuietExec MSI (s) (F8:5C) [16:57:15:780]: Generating random cookie. MSI (s) (F8:5C) [16:57:15:782]: Created Custom Action Server with PID 6872 (0x1AD8). MSI (s) (F8:78) [16:57:15:809]: Running as a service. MSI (s) (F8:78) [16:57:15:810]: Hello, I'm your 32bit Elevated custom action server. MSI (s) (F8!4C) [16:57:15:819]: Creating MSIHANDLE (112) of type 790531 for thread 2892 MSI (s) (F8!4C) [16:57:15:820]: Closing MSIHANDLE (112) of type 790531 for thread 2892 MSI (s) (F8!4C) [16:57:15:820]: Creating MSIHANDLE (113) of type 790531 for thread 2892 CAQuietExec: Command string must begin with quoted application name. MSI (s) (F8!4C) [16:57:15:820]: Closing MSIHANDLE (113) of type 790531 for thread 2892 MSI (s) (F8!4C) [16:57:15:820]: Creating MSIHANDLE (114) of type 790531 for thread 2892 CAQuietExec: Error 0x80070057: invalid command line property value MSI (s) (F8!4C) [16:57:15:820]: Closing MSIHANDLE (114) of type 790531 for thread 2892 CAQuietExec: Error 0x80070057: failed to get Command Line

. 내가 뭘 잘못하고있어?

답변

1

rmdir은 실행할 수있는 EXE가 아니며 cmd.exe 내부의 셸 명령입니다.

나는 RemoveFolderEx Element (Util Extension)을보고 싶습니다. 설치가 실패하거나 취소 된 경우 삭제 롤백을 포함하여 훨씬 더 나은 솔루션이 될 것입니다. (매우 중요 함)

+0

예, 적절한 오류 및 예외 처리 기능이있는 코드화 된 사용자 지정 동작에 제대로 포함되어 있지 않으면 MSI에서와 같은 셸 명령을 사용하는 것이 안티 패턴입니다. 그리고 대안이있는 경우에도 사용하지 않을 것입니다. . Util 확장을 확실히 사용하십시오. –

+0

답변 해 주셔서 감사합니다. 'RemoveFolderEx' 엘리먼트의 위치는 약간 까다 롭습니다 ('component'의 자식처럼). 그러나 그것은 제 문제를 완전히 해결했습니다. – frankenpfalzer

관련 문제