您的位置:首页 > 移动开发

WiX Wrapper Exe installer

2015-11-26 16:06 661 查看
WiX Wrapper Exe installer

使用WiX来封装Exe成为MSI文件
https://github.com/pennmanor/wix-wrapper/blob/master/owncloud.wxs
<?xml version='1.0'?>

<?define ProductVersion = "2.0.2"?> <!-- Match ownCloud Client version -->

<?define PrevProductVersion = "2.0.1"?> <!-- Match previous ownCloud Client version -->

<?define ExeSourceFile = "ownCloud-2.0.2.5569-setup.exe"?> <!-- Match new .exe -->

<?define ProductCode = "87CA6CC7-4F67-4663-974A-53BA46DA8E34"?> <!-- Regenerate for new upgrade -->

<?define ProductUpgradeCode = "5a4f6818-b8b2-4fda-b43c-9959a6d734ad"?> <!-- When upgrading, move previous ProductCode here -->

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>

        <Product Id='*'

                UpgradeCode="$(var.ProductUpgradeCode)"

                Name='ownCloud Sync Client'

                Language='1033'

                Version='$(var.ProductVersion)'

                Manufacturer='Penn Manor ownCloud'>

                <Package Id='$(var.ProductCode)'

                        Description='ownCloud Client $(var.ProductVersion)'

                        InstallerVersion='200'

                        Compressed='yes' />

                <Media Id='1' Cabinet='setup.cab' EmbedCab='yes' />

                <Directory Id='TARGETDIR' Name='SourceDir'>

                        <Directory Id="TempFolder">

                                <Directory Id="INSTALLLOCATION" Name="~_tmpdir">

                                        <Component Id='MyComponent' DiskId='1' Guid='B3514243-DFB8-4BB1-8495-ED6153468361'>

                                                <File Id="File0" Name="$(var.ExeSourceFile)" Source="$(var.ExeSourceFile)" />

                                        </Component>

                                </Directory>

                        </Directory>

                </Directory>

                <Upgrade Id="$(var.ProductUpgradeCode)">

                        <UpgradeVersion Minimum="$(var.ProductVersion)"

                                IncludeMinimum="no"

                                OnlyDetect="yes"

                                Language="1033"

                                Property="NEWPRODUCTFOUND" />

                        <UpgradeVersion Minimum="$(var.PrevProductVersion)"

                                IncludeMinimum="yes"

                                Maximum="$(var.ProductVersion)"

                                IncludeMaximum="no"

                                Language="1033"

                                Property="UPGRADEFOUND" />

                </Upgrade>

                <Property Id="ARPSYSTEMCOMPONENT" Value="1" />

                <Feature Id='InstallFeature' Title='Install Feature' Level='1'>

                        <ComponentRef Id='MyComponent' />

                </Feature>

                <!-- Prevent downgrading -->

                <CustomAction Id="PreventDowngrading" Error="Newer version already installed." />

                <InstallUISequence>

                        <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>

                </InstallUISequence>

                <!-- Run Action -->

                <CustomAction Id="RunWrapExe"

                        Return="ignore"

                        Execute="deferred"

                        FileKey="File0"

                        ExeCommand="$(var.ExeSourceFile) /S"

                        HideTarget="no"

                        Impersonate="no" />

                <InstallExecuteSequence>

                        <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>

                        <Custom Action="RunWrapExe" After="InstallFiles">NOT REMOVE~="ALL"</Custom>

                        <RemoveExistingProducts After="InstallFinalize" />

                </InstallExecuteSequence>

        </Product>

</Wix>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  wix msi installer