으로 이동 나는 모두 자신의 WiX 설치 프로그램이있는 관련 응용 프로그램 모음을 작성 중입니다. 당신이 상상할 수 있듯이,이 설치자들 사이에 많은 중복이 있습니다. 나는 그것에 대해 뭔가하려고 노력하고 있습니다. 이를 위해 .wxs
파일을 포함하는 WiX Library Project를 만들었으며 가능한 한 많은 코드를 .wxs
개의 파일로 밀어 넣으려고했습니다. 지금까지 대부분 잘 돌아갔다. 그러나 .wxs
으로 이동할 수없는 한 가지가 있습니다 (Upgrade
요소).Wix : <Upgrade>을 <Fragment>
이 내 업그레이드 코드 :
<Upgrade Id="MY-UPGRADE-CODE-GUID">
<!-- If an older version is found replace it -->
<UpgradeVersion OnlyDetect="no" Property="OLDERFOUND"
Maximum="$(var.ProductVersion)" IncludeMaximum="no"/>
<!-- If the same version is found do nothing (OnlyDetect) -->
<UpgradeVersion OnlyDetect="yes" Property="SELFFOUND"
Minimum="$(var.ProductVersion)" IncludeMinimum="yes"
Maximum="$(var.ProductVersion)" IncludeMaximum="yes"/>
<!-- If a newer version is found do nothing (OnlyDetect) -->
<UpgradeVersion OnlyDetect="yes" Property="NEWERFOUND"
Minimum="$(var.ProductVersion)" IncludeMinimum="no"/>
</Upgrade>
<CustomAction Id="AlreadyUpdated" Error="This version of !(wix.Param.Upgrade.ProductName) is already installed. You will have to uninstall it manually before this installer can continue."/>
<CustomAction Id="NoDowngrade" Error="A newer version of !(wix.Param.Upgrade.ProductName) is already installed. You will have to uninstall that version manually before this installer can continue."/>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize"/>
<!-- If the same version is found execute AlreadyUpdated -->
<Custom Action="AlreadyUpdated" After="FindRelatedProducts">SELFFOUND</Custom>
<!-- If a newer version is found execute NoDowngrade -->
<Custom Action="NoDowngrade" After="FindRelatedProducts">NEWERFOUND</Custom>
</InstallExecuteSequence>
는 Upgrade/@Id
를 들어, 내가 Product/@UpgradeCode
과 같은 값을 사용합니다. (나는 그것이 필요한지 또는 좋은 연습인지는 확실하지 않다.) 어떤 점에서는 WixVariable
에 넣고 싶지만 현재는 리터럴 GUID와 함께 작동하도록 노력하고있다.
나는 이미 파일에 CustomAction
과 InstallExecuteSequence
을 Fragment
으로 옮겼습니다. ProductName을 포함하도록 WixVariable
을 정의 했으므로 각 앱의 설치 프로그램에 고유 이름을 표시하도록 할 수 있습니다. 이것은 내가 원하는 방식으로 정확하게 작동합니다. 나는 그것이 응용 프로그램의 Product.wxs
파일 또는 라이브러리 .wxs
파일 중 하나 있다면 그것은 중요하지 않습니다 (A Fragment
에 Upgrade
요소를 이동하고, 또한 문제가되지 않을 때
Fragment
은 동일
경우 InstallExecuteSequence
를 포함하는 하나의), 다음과 같은 문제가 발생합니다
- 내가 먼저 설치 프로그램의 이전 버전을 실행하는 경우, 다음
Upgrade
와 새가 별도의Fragment
로 이동하지만, 동일Product/@Version
,[email protected]/UpgradeCode
하고,Upgrade/@Id
, 2 번 설치로 끝납니다. 나는 분명히 내가 원하는 제품이 아니다. - 새 설치 프로그램을 두 번 설치하면 두 번째 설치 (원하는 내용)가되지 않지만 내 오류 메시지도 표시되지 않습니다.
나는, 더 중요한 것은, 사실 1)는 동일한 버전을 다시 설치할 때 오류 메시지를주고 싶어하지 않는 것하지 않는 것이 있었다하는 MajorUpgrade
로 전체를 교체하고 것 2) 어떤 이유로 든 Fragment
안에 들어갈 수 없으므로 (이전보다 훨씬 적지 만) 여전히 복제가 붙어 있습니다.
그래서 ... Upgrade
요소를 현재 기능을 잃지 않고 .wxs
라이브러리로 옮길 수 있습니까? 내가 도대체 뭘 잘못하고있는 겁니까?
MSI 패키지에는 조각의 내용이 포함되어 있지 않은 것 같습니다. Orca에서 결과 MSI를 열고 예를 들어 확인하면 확인할 수 있습니다. 예를 들어 InstallExecuteSequence 테이블. AlreadyUpdated 사용자 지정 작업. 가정이 맞다면 메인 wxs 파일의 조각에서 어떤 요소라도 참조해야합니다. 물론 CustomAction/CustomActionRef와 같은 Ref 형제가있는 요소 여야합니다. 이 경우 전체 조각이 포함됩니다. –
FYI MajorUpgrade는이 코드를 한 줄로 줄입니다. http://wix.sourceforge.net/manual-wix3/major_upgrade.htm http://wix.sourceforge.net/manual-wix3/wix_xsd_majorupgrade.htm –
@caveman_dick 알다시피 말했듯이'Fragment'에서는 허용되지 않으며'Product' 환경에서만 사용할 수 있으므로 WiX Library Project에서는 사용할 수 없습니다. 비록 지금은 내가 사용하고 있지만 (받아 들여진 대답을 참조하십시오), 더 이상 문제가 아닙니다 ... – jqno