2016-07-06 4 views
0

응용 프로그램 업그레이드를 허용하려고합니다. 사용자가 1.0.0을 설치하면 다음 번에 버전을 릴리스 할 때 1.1.0을 제공 할 수 있으며 설치할 수 있습니다. Overwriting | removing | replacing the first version 버전을 제어판 -> 제거 또는 프로그램으로 만 설치해야합니다.응용 프로그램 업그레이드 허용

내 문제는 다음과 같습니다

내가 설정하지 않은 경우

제품 ID가 동일 * (사용 $ (var.ProductId)는 "대신에) 나는이 제품의 또 다른 버전이 이미 설치되어

를 얻을. 이 버전 계속할 수 없습니다 의 설치 ...

가 나는 그것이 * 다음 새 버전을 설치하기 위해 동일한 나는 두 가지 버전이 설치되어 설정합니다.

나는 이것을 테스트하기 위해 간단한 wix 응용 프로그램을 만들었습니다.

<?xml version="1.0" encoding="UTF-8"?> 
<?define ProductVersion="!(bind.FileVersion.MyAssemblyDll)"?> 
<?define UpgradeCode="f4d7f199-28f6-45d5-ad99-7c62938274be"?> 
<?define ProductId="{6408D956-40DA-4AEE-883E-5425F1562004}"?> 
<?define Version="1.2.0"?> 

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="$(var.ProductId)" Name="UpgradeTest" Language="1033" Version="$(var.Version)" Manufacturer="xxx" UpgradeCode="$(var.UpgradeCode)"> 
     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

    <!-- prevents down gradeing --> 
    <!-- one upgrade installes new version first then removes the old one. --> 
     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallExecute"/> 
     <MediaTemplate EmbedCab="yes"/> 

     <Feature Id="ProductFeature" Title="UpgradeTest" Level="1"> 
      <ComponentGroupRef Id="ProductComponents" /> 
     </Feature> 
    </Product> 

    <Fragment> 
     <Directory Id="TARGETDIR" Name="SourceDir"> 
      <Directory Id="ProgramFilesFolder"> 
       <Directory Id="INSTALLFOLDER" Name="UpgradeTest" /> 
      </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"> 
     <File Id="Product.wxs" Source="Product.wxs" KeyPath="yes" /> 
      </Component> 
     </ComponentGroup> 
    </Fragment> 
</Wix> 

나는이 지금은 멀리 뒤로 어떤 도움을 크게 감상 할 수있다 2008 년에 모든 자습서를 소진 며칠 동안 작동하도록하기 위해 노력 해왔다.

업데이트 : 나쁜

<MajorUpgrade AllowDowngrades="no" DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="no" /> 

: 제어판의 두 가지 버전으로 결과.

업데이트 2 : 나쁜

<Upgrade Id ="$(var.ProductUpgradeCode)"> 
    <UpgradeVersion Minimum="$(var.ProductFullVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/> 
    <UpgradeVersion Maximum="$(var.ProductFullVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED"/> 
</Upgrade> 


<InstallExecuteSequence> 
    <RemoveExistingProducts After="InstallValidate"/> 
</InstallExecuteSequence> 

<Condition Message="A newer version of [ProductName] is already installed. If you are sure you want to downgrade, remove the existing installation via Programs and Features.">Not NEWERVERSIONDETECTED</Condition> 

: 제어판의 두 가지 버전으로 결과.

답변

1

나는 그것이 UpgradeCode에 대한 GUID를 사용하고 있지만 *에서 제품의 Id을 떠나했던 방법. 그런 다음 다시 설치 속성을 amus으로 설정하여 원하는 방식으로 제품을 다시 설치하십시오.

그것은 일종의하지만, amus 당신은 Microsoft 설명서 here를 참조하지만 조심 수 있습니다은이

<Product Id="*" 
     Name="YourProductName" 
     Language="1033" 
     Version="YourProductVersion" 
     Manufacturer="YourCompany" 
     UpgradeCode="{SOME-GUID}"> 

<SetProperty Id="REINSTALLMODE" Value="amus" After="FindRelatedProducts">Installed AND REMOVE&lt;&gt;"ALL"</SetProperty> 

처럼 보일 것입니다. a 값을 사용하면 설치된 버전이 더 최신 버전 인 경우에도 응용 프로그램이 다시 설치됩니다. 그러나 설치 프로그램에 필요한 문자를 파악할 수 있습니다.

+0

작동하지 않았습니다. 그것은 내가 전에 보지 못했던 설치를 끝내기 위해 PC를 다시 부팅하라고 요구했습니다. 그러나 나는 여전히 최신 버전이 아니라 기계에 설치된 두 가지 버전으로 끝났습니다. – DaImTo

0

없음 (기본값)로 설정하면 Wix website

에서이

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" Schedule="afterInstallExecute"/> 

<MajorUpgrade> 요소를 변경 동일한 버전의 제품을 설치하십시오 코드 (하지만 서로 다른 제품을 업그레이드 코드)는 MSI에서 두 제품으로 허용되고 처리됩니다.yes로 설정하면 WiX는 msidbUpgradeAttributesVersionMaxInclusive 특성을 설정합니다.이 특성은 MSI에게 주요 업그레이드와 동일한 버전의 제품을 처리하도록 지시합니다.

두 설치가 관련이없는 것처럼 처리됩니다. 나는 이것이 이상한 행동이라고 생각하지만 마이크로 소프트를 비난한다.

+0

내 응용 프로그램의 한 버전 만 최신 버전으로 설치하기를 원하는 부분을 잘못 이해했다고 생각하십시오. 이것은 1.0.0.0과 1.2.0.0이 설치된 두 가지 버전을 설치합니다. 난 단지 내 응용 프로그램의 한 버전이 설치되어 있어야합니다. – DaImTo

관련 문제