32/64位WiX组合安装程序仅复制文件

32/64位WiX组合安装程序仅复制文件,wix,windows-installer,twincat,Wix,Windows Installer,Twincat,我有一个msi,它将文件(PLC代码)复制到一个目录(C:\Product\3.1\Boot),并修改一个键 我的visual studio项目为不同的体系结构生成不同的PLC代码,但目标在两种平台上是相同的。他们的钥匙在另一个地方 我已经研究过使用arch开关和条件语句,但是这些语句只检测编译它的架构,而不是msi的运行位置 我知道你不能在同一个MSI中有32/64,但我除了复制文件和更改注册表之外什么都不做。我没有在windows目录/程序文件中放入任何内容 尽管我希望它与程序列表中的版本一

我有一个msi,它将文件(PLC代码)复制到一个目录(C:\Product\3.1\Boot),并修改一个键

我的visual studio项目为不同的体系结构生成不同的PLC代码,但目标在两种平台上是相同的。他们的钥匙在另一个地方

我已经研究过使用arch开关和条件语句,但是这些语句只检测编译它的架构,而不是msi的运行位置

我知道你不能在同一个MSI中有32/64,但我除了复制文件和更改注册表之外什么都不做。我没有在windows目录/程序文件中放入任何内容

尽管我希望它与程序列表中的版本一起出现

在这种情况下,是否可能有一个安装程序

代码 '''



''

我能想出如何让它工作。通过使用条件和![CDATA[非(VersionNT64)]要检测版本,我可以执行不同的操作



你能分享你的wix代码吗?嘿,帕维尔,我添加了代码。我的问题更具假设性,因为我已经使用WiX一天了,我读到的所有信息都表明这是不可能的。64位安装程序可以安装32位组件和文件,但64位安装程序不能在x86系统上运行(到现在为止,还只是古老的机器)。32位安装程序可以在64位系统上运行。问题是您是否需要支持下游机器?我们确实有一些x86机器,但将来不应该。我不完全清楚“安装”实际上意味着什么。我只想复制这些文件,更改注册表,并在“添加/删除程序”列表中创建一个条目。将来我想启动/停止一些服务,但我不想安装任何服务。我的安装程序需要知道它在哪个系统上运行,因为为32位生成的文件与为64位生成的文件不同。我不是软件人,所以我的知识有限。现在正在学习。这里有几个链接。请检查一下:。
<Product Id="*" 
         Name="Company" 
         Language="1033" 
         Version="4.09" 
         Manufacturer="CompanyInc." 
         UpgradeCode="YOUR_GUID"
         >
    <Package Id ="*" 
             InstallerVersion="200" 
             InstallPrivileges="elevated"
             Compressed="yes" 
             InstallScope="perMachine"
             Description="Company PLC Code"
             Manufacturer="CompanyInc."
             Keywords="PLC"
             Comments="F"
             />

    <!--Upgrade/install control-->
    <MajorUpgrade 
                  AllowDowngrades="yes"
                  />

    <!--GUI for install display-->



    <UI>
        <UIRef Id="WixUI_Minimal" />    <!--Define type of UI -->
    </UI>


    <Upgrade Id="GUID_HERE">
        <UpgradeVersion OnlyDetect="no" 
                        Property="SELFFOUND"
                        Minimum="1.0"
                        />
    </Upgrade>


    <MediaTemplate EmbedCab="yes" />

    <!-- Set the icon used in the programs and features list-->
    <Icon Id='ProductIcon' SourceFile='Company.ico' />
    <Property Id='ARPPRODUCTICON' Value='ProductIcon' />


    <!-- Things to install-->
    <Feature Id="Default" Title="PLC Code" Level="1">
        <ComponentGroupRef Id="ProductComponentsx64" />
    </Feature>

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="Company PLC" />
            <Directory Id="BOOTDIR" />
                <Directory Id="PLCDIR" />
        </Directory>

    </Directory>

    <SetDirectory Id="BOOTDIR" Value="C:\CompanySoftware\3.1\Boot" />
    <SetDirectory Id="PLCDIR" Value="C:\CompanySoftware\3.1\Boot\Plc" />


    <!--Specify when actions occur actions during install-->
    <InstallExecuteSequence>
        <Custom Action="ARCHIVEBOOTDIR" After ="CostFinalize"  />
        <!--ToDo: copy files-->
    </InstallExecuteSequence>
</Product>




<Fragment>
    <!--64 bit systems: Place files in appropriate directories and modify registry key for Company to autostart -->
    <ComponentGroup Id="ProductComponentsx64">
        <Component Id="BootComponents" Guid="" Directory="BOOTDIR">
            <File Id="CurrentConfig.xml" Source="..\_Boot\CompanySoftware RT (x64)\CurrentConfig.xml" KeyPath="no" />
        </Component>
        <Component Id="PLCComponent" Guid="" Directory="PLCDIR">
            <File Id="Port_851.app" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.app" KeyPath="no" />
            <File Id="Port_851.autostart" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.autostart" KeyPath="no" />
            <File Id="Port_851.cid" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.cid" KeyPath="no" />
            <File Id="Port_851.crc" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.crc" KeyPath="no" />
            <File Id="Port_851.occ" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.occ" KeyPath="no" />
            <File Id="Port_851.ocm" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.ocm" KeyPath="no" />
            <File Id="Port_851_boot.tizip" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851_boot.tizip" KeyPath="no" />
        </Component>
        <Component Id="StartupReg" Guid="" Directory="TARGETDIR">
            <RegistryKey Root="HKLM"
                         Key="Software\WOW6432Node\Company\CompanySoftware3\System">
                <RegistryValue Name="SysStartupState"
                               Type="integer"
                               Value ="5"/>
            </RegistryKey>
        </Component>
    </ComponentGroup>
</Fragment>


<Fragment>
    <!--32 bit systems: Place files in appropriate directories and modify registry key for Company to autostart -->
    <ComponentGroup Id="ProductComponentsx86">
        <Component Id="BootComponents" Guid="" Directory="BOOTDIR">
            <File Id="CurrentConfig.xml" Source="..\_Boot\CompanySoftware RT (x86)\CurrentConfig.xml" KeyPath="no" />
            <File Id="Company.ico" Source="Company.ico" KeyPath="no" />
        </Component>
        <Component Id="PLCComponent" Guid="" Directory="PLCDIR">
            <File Id="Port_851.app" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.app" KeyPath="no" />
            <File Id="Port_851.autostart" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.autostart" KeyPath="no" />
            <File Id="Port_851.cid" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.cid" KeyPath="no" />
            <File Id="Port_851.crc" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.crc" KeyPath="no" />
            <File Id="Port_851.occ" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.occ" KeyPath="no" />
            <File Id="Port_851.ocm" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.ocm" KeyPath="no" />
            <File Id="Port_851_boot.tizip" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851_boot.tizip" KeyPath="no" />
        </Component>
        <Component Id="StartupReg" Guid="" Directory="TARGETDIR">
            <RegistryKey Root="HKLM"
                         Key="Software\Company\CompanySoftware3\System">
                <RegistryValue Name="SysStartupState"
                               Type="integer"
                               Value ="5"/>
            </RegistryKey>
        </Component>
    </ComponentGroup>
</Fragment>
<Product Id="*"
         Name="Company PLC"
         Language="1033"
         Version="4.09"
         Manufacturer="Company Inc."
         UpgradeCode="Code"
         >
    <Package Id ="*"
             InstallerVersion="200"
             InstallPrivileges="elevated"
             Compressed="yes"
             InstallScope="perMachine"
             Description="Company CompanySoftware PLC Code"
             Manufacturer="Company Inc."
             Keywords="PLC"
             Comments="Company "
             />

    <!--Upgrade/install control-->
    <MajorUpgrade
                  AllowDowngrades="yes"
                  />

    <!--GUI for install display-->

    <!-- future use for custom graphics on the MSI pages
    <WixVariable Id="WixUIBannerBmp" Value="CompanyWixUIBanner.bmp" />
    <WixVariable Id="WixUIDialogBmp" Value="CompanyWixUIBanner.bmp" />
    -->

    <UI>
        <UIRef Id="WixUI_Minimal" />
        <!--Define type of UI -->
    </UI>


    <Upgrade Id="CODE">
        <UpgradeVersion OnlyDetect="no"
                        Property="SELFFOUND"
                        Minimum="1.0"
                        />
    </Upgrade>


    <MediaTemplate EmbedCab="yes" />

    <!-- Set the icon used in the Windows programs and features list-->
    <Icon Id='ProductIcon' SourceFile='Company.ico' />
    <Property Id='ARPPRODUCTICON' Value='ProductIcon' />


    <!-- Things to install- This would normally appear as the selectable list of items to install in a regular installer-->
    <Feature Id="Default_x64" Title="PLC Code x64" Level="1">
        <Condition Level ="1">
            <![CDATA[(VersionNT64)]]>
        </Condition>
            <ComponentGroupRef Id="ProductComponentsx64" />
    </Feature>

    <Feature Id="Default_x86" Title="PLC Code x86" Level="1">
        <Condition Level ="1">
            <![CDATA[NOT(VersionNT64)]]>
        </Condition>
        <ComponentGroupRef Id="ProductComponentsx86" />
    </Feature>


    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="Company PLC" />
            <Directory Id="BOOTDIR" />
            <Directory Id="PLCDIR" />
        </Directory>

    </Directory>

    <SetDirectory Id="BOOTDIR" Value="C:\CompanySoftware\3.1\Boot" />
    <SetDirectory Id="PLCDIR" Value="C:\CompanySoftware\3.1\Boot\Plc" />


</Product>




<Fragment>
    <!--64 bit systems: Place files in appropriate directories and modify registry key for Company to autostart -->
    <ComponentGroup Id="ProductComponentsx64">
        <Component Id="BootComponentsx64" Guid="" Directory="BOOTDIR">
            <Condition>
                <![CDATA[(VersionNT64)]]>
            </Condition>
            <File Id="CurrentConfig.xml.x64" Source="..\_Boot\CompanySoftware RT (x64)\CurrentConfig.xml" KeyPath="no" />
        </Component>
        <Component Id="PLCComponent.x64" Guid="" Directory="PLCDIR">
            <Condition>
                <![CDATA[(VersionNT64)]]>
            </Condition>
            <File Id="Port_851.app.x64" Source="..\_Boot\CompanySoftware RT (x64)\Plc\Port_851.app" KeyPath="no" />
        </Component>
        <Component Id="StartupReg.x64" Guid="" Directory="TARGETDIR">
            <Condition>
                <![CDATA[(VersionNT64)]]>
            </Condition>
            <RegistryKey Root="HKLM"
                         Key="Software\WOW6432Node\Company\CompanySoftware\System">
                <RegistryValue Name="SysStartupState"
                               Type="integer"
                               Value ="5"/>
            </RegistryKey>
        </Component>
    </ComponentGroup>
</Fragment>


<Fragment>
    <!--32 bit systems: Place files in appropriate directories and modify registry key for Company to autostart -->
    <ComponentGroup Id="ProductComponentsx86">
        <Component Id="BootComponentsx86" Guid="" Directory="BOOTDIR">
            <Condition>
                <![CDATA[NOT(VersionNT64)]]>
            </Condition>
            <File Id="CurrentConfig.xml.x86" Source="..\_Boot\CompanySoftware RT (x86)\CurrentConfig.xml" KeyPath="no" />
        </Component>
        <Component Id="PLCComponentx86" Guid="" Directory="PLCDIR">
            <Condition>
                <![CDATA[NOT(VersionNT64)]]>
            </Condition>
            <File Id="Port_851.app.x86" Source="..\_Boot\CompanySoftware RT (x86)\Plc\Port_851.app" KeyPath="no" />
        </Component>
        <Component Id="StartupReg.x86" Guid="" Directory="TARGETDIR">
            <Condition>
                <![CDATA[NOT(VersionNT64)]]>
            </Condition>
            <RegistryKey Root="HKLM"
                         Key="Software\Company\CompanySoftware\System">
                <RegistryValue Name="SysStartupState"
                               Type="integer"
                               Value ="5"/>
            </RegistryKey>
        </Component>
    </ComponentGroup>
</Fragment>