2017-09-18 6 views
0

ProductIds 및 버전을 제외하고 동일한 두 개의 MSI가 있습니다. MajorUpgrade 경로 to make sure it's seamless for end users을 테스트하고 있습니다.MajorUpgrade는 이전 버전을 제거하지만 MSI가 두 번째 실행되지 않는 한 새 버전을 설치하지 않습니다.

높은 버전의 MSI는 Windows 서비스를 종료하고 모든 아티팩트를 제거하지만 1603 오류가있는 "새"2 진 파일을 설치하는 데 실패합니다. 사실, 파일 및 레지스트리 정리를 포함하여 제거를 실행하는 것처럼 보이지만 설치를 실행하지 못합니다.

더 높은 버전의 MSI를 다시 실행하면 파일 및 디렉토리가 만들어지고 Windows 서비스가 시작되고 설치 완료 후 실행되도록 설정된 실행 파일도 정상적으로 작동합니다.

자세한 로그가 생성되었지만 문제가있는 것으로 수정되었습니다 (파일이 올바른 위치에 복사되지 않음).

윅스 코드 :

<Product Id="*" 
    Name="product name" 
    Language="1033" 
    Version="1.2.0" 
    Manufacturer="Company Name" 
    UpgradeCode="stable-upgrade-guid"> 

<!-- snip --> 

<Property Id="WixShellExecTarget" Value="[#TheProgram.exe]" /> 
    <CustomAction Id="LaunchApplication" 
        BinaryKey="WixCA" 
        DllEntry="WixShellExec" 
        Impersonate="yes" /> 

    <MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." /> 

    <InstallExecuteSequence> 
     <Custom Action="CheckForRunningProcesses_CA" After="InstallValidate" /> 
     <Custom Action="LaunchApplication" After="InstallFinalize"/> 
    </InstallExecuteSequence> 

나는 msiexec /i "product.msi" /l*v "upgrade.log"와 아래 로그를 생성합니다.

MSI (s) (70:B0) [14:30:58:905]: Note: 1: 2318 2: 
MSI (s) (70:B0) [14:30:58:905]: Note: 1: 1321 2: C:\Config.Msi\ 3: 5 
MSI (s) (70:B0) [14:30:58:905]: Note: 1: 2205 2: 3: Error 
MSI (s) (70:B0) [14:30:58:905]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 2911 
DEBUG: Error 2911: Could not remove the folder C:\Config.Msi\. 
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2911. The arguments are: C:\Config.Msi\, , 
MSI (s) (70:B0) [14:30:58:908]: Note: 1: 2318 2: 
MSI (s) (70:B0) [14:30:58:908]: Calling SRSetRestorePoint API. dwRestorePtType: 0, dwEventType: 103, llSequenceNumber: 14, szDescription: "". 
MSI (s) (70:B0) [14:30:58:909]: The call to SRSetRestorePoint API succeeded. Returned status: 0. 
MSI (s) (70:B0) [14:30:58:909]: Unlocking Server 
MSI (s) (70:B0) [14:30:58:911]: PROPERTY CHANGE: Deleting UpdateStarted property. Its current value is '1'. 
Action ended 14:30:58: InstallFinalize. Return value 1. 
MSI (s) (70:B0) [14:30:58:912]: Doing action: LaunchApplication 
MSI (s) (70:B0) [14:30:58:912]: Note: 1: 2205 2: 3: ActionText 
Action 14:30:58: LaunchApplication. 
Action start 14:30:58: LaunchApplication. 
MSI (s) (70:58) [14:30:58:915]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI12D1.tmp, Entrypoint: WixShellExec 
WixShellExec: Error 0x80070002: ShellExec failed with return code 2. 
WixShellExec: Error 0x80070002: failed to launch target 
CustomAction LaunchApplication returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) 
Action ended 14:30:58: LaunchApplication. Return value 3. 
Action ended 14:30:58: INSTALL. Return value 3. 
  • 내가 ShellExec 리턴 코드 2 개 수단 "파일을 찾을 수 없습니다"믿는이는 관련 비트 것으로 보인다. (사실, 프로그램 파일 디렉토리가 존재하지 않습니다.)
  • 반환 값이 3 인 LaunchApplication은 무엇을 의미하는지 모르겠습니다. 나는 "파일을 찾을 수 없다"고 생각합니다.

MajorUpgrade가 이전 버전을 제거하지만 새 버전을 설치하지는 않지만 이후 실행시에 어떤 이유가 있는지 알기 원하십니까?

+0

중복되지 않습니다. 비슷한 증상, 완전히 다른 로그 파일. 해결책은 같았지만 근본적인 문제는 달랐습니다. – rianjs

답변

1

당연히 나는 질문을 한 후에 대답을 발견합니다. 단서는이 문제를 해결하려면 어떻게 든 내가 보지 못한 in this StackOverflow question, ...

을했다, 당신은 나중에 RemoveExistingProducts 작업을 이동해야합니다. MajorUpgrade 요소를 사용하는 경우 Schedule='afterInstallExecute' 또는 Schedule='afterInstallFinalize' 트릭을 수행해야합니다. 구성 요소 규칙에 더 많은주의를 기울여 해야합니다. 모든 명백한

<MajorUpgrade 
     DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." 
     Schedule="afterInstallExecute" /> 

되지 않음 : afterInstallExecuteMajorUpdate의 일정을 변경

는 수정했습니다.