Wix 64bit System64Folder ProgramFiles64Folder

本文详细解析了Wix安装配置文件的结构和关键组成部分,包括产品ID、语言、版本、制造商、升级代码等信息,以及媒体ID、压缩包、目录路径、组件ID、文件路径等元素。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="60494ab4-c90a-4fe4-b6da-79d64b3efa21" Name="WixDokan" Language="1033" Version="1.0.0.0" Manufacturer="WixDokan" UpgradeCode="521d3350-c307-4cae-bd94-77217fd31bb1">
<Package InstallerVersion="200" Compressed="yes" />


<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />


<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLLOCATION" Name="WixDokan">
            <Component Id="MSI_1"  DiskId="1" Guid="521d3350-c307-4cae-bd94-77217fd31b01">
              <File  Id="mydwg" Name="12345.dwg"
     src="12345.dwg"  />
            </Component>
        </Directory>
</Directory>
      <Directory Id="System64Folder" Name="System">
        <Component Id="MSI_2"  DiskId="1" Guid="521d3350-c307-4cae-bd94-77217fd31b06">
          <File  Id="wilsonTest" Name="wilsonTest.txt"
 src="wilsonTest.txt"  />
        </Component>
      </Directory>
</Directory>


  


    <InstallExecuteSequence>
      <!--<Custom Action="ShowReadMe" After="InstallFinalize">Not Installed</Custom>-->
      <!--<Custom Action="BatchCmd" Before="InstallFiles">NOT INSTALLED</Custom>-->
    </InstallExecuteSequence>


<Feature Id="ProductFeature" Title="WixDokan" Level="1" AllowAdvertise="no"
        ConfigurableDirectory="TARGETDIR"  Description="Drivers"
        Display="collapse" >
      <ComponentRef  Id='MSI_1' />
      <ComponentRef  Id='MSI_2' />
      <ComponentGroupRef Id="Product.Generated" />
</Feature>
    <UI>
      <UIRef Id="WixUI_Mondo" />
      <UIRef Id="WixUI_ErrorProgressText" />
    </UI>
</Product>
</Wix>

下面是Wix定义的系统文件夹:

PersonalFolder       Full path to Documents folder for current user
PrintHoodFolder      Full path to PrintHood folder
ProgramFiles64Folder Full path to 64-bit Program Files folder
ProgramFilesFolder   Full path to 32-bit Program Files folder
ProgramMenuFolder    Full path to Program Menu folder
RecentFolder         Full path to Recent folder
SendToFolder         Full path to SendTo folder for current user
StartMenuFolder      Full path to Start Menu folder
StartupFolder        Full path to Startup folder
System16Folder       Full path to 16-bit system DLLs folder
System64Folder       Full path to System64 folder
SystemFolder         Full path to System folder for current user
TempFolder           Full path to Temp folder
TemplateFolder       Full path to Template folder for current user
WindowsFolder        Full path to Windows folder


 

<?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://wixtoolset.org/schemas/v6/wxs"> <Package Id="AcmeCorp.QuickStartExample" Name="MyApp" Manufacturer="MyCompany" Version="1.0.0.0" InstallerVersion="600" Compressed="yes" InstallScope="perMachine"> <!-- 主程序文件 --> <File Source="MyApp.exe" /> <!-- 目录结构 --> <StandardDirectory Id="ProgramFiles64Folder"> <Directory Id="INSTALLDIR" Name="MyApp"> <Component> <File Source="MyApp.exe" /> </Component> </Directory> </StandardDirectory> <!-- 桌面快捷方式 --> <StandardDirectory Id="DesktopFolder"> <Component> <Shortcut Id="DesktopShortcut" Name="MyApp" Target="[INSTALLDIR]MyApp.exe" WorkingDirectory="INSTALLDIR"/> <RegistryValue Root="HKCU" Key="Software\MyCompany\MyApp" Name="DesktopShortcutInstalled" Type="integer" Value="1" KeyPath="yes"/> </Component> </StandardDirectory> <!-- 功能定义 --> <Feature Id="MainFeature" Title="Main Application" Level="1"> <ComponentRef Id="Component_INSTALLDIR" /> <ComponentRef Id="Component_DesktopFolder" /> </Feature> <!-- 平台条件:仅64位系统 --> <Condition Message="This installer requires a 64-bit version of Windows."> <![CDATA[Installed OR VersionNT64]]> </Condition> </Package> </Wix> 报错:D:\QuickStart>dotnet build 还原完成(0.4) QuickStart 失败,出现 2 错误 (1.6 秒) D:\QuickStart\Package.wxs(2): error WIX0199: The Wix element has an incorrect namespace of 'http://wixtoolset.org/schemas/v6/wxs'. Please make the Wix element look like the following: <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">. D:\QuickStart\Package.wxs(2): error WIX0199: The Wix element has an incorrect namespace of 'http://wixtoolset.org/schemas/v6/wxs'. Please make the Wix element look like the following: <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">. 在 2.2 秒内生成 失败,出现 2 错误 怎么解决,输出修改后的完整代码
最新发布
07-29
<?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://wixtoolset.org/schemas/v6/wxs"> <!-- 包级属性 --> <Package InstallerVersion="600" Compressed="yes" InstallScope="perMachine" Platform="x64" Manufacturer="MyCompany"/> <Product Id="*" Name="MyApp" Language="1033" Version="1.0.0.0"> <!-- 目录结构 --> <StandardDirectory Id="ProgramFiles64Folder"> <Directory Id="INSTALLDIR" Name="MyApp"> <Component> <File Source="MyApp.exe" /> </Component> </Directory> </StandardDirectory> <Directory Id="INSTALLDIR" Name="MyApp"> <Component> <File Source="MyApp.exe" /> </Component> </Directory> </StandardDirectory> <!-- 快捷方式 (v6兼容性修复) --> <StandardDirectory Id="DesktopFolder"> <Component> <Shortcut Id="DesktopShortcut" Name="MyApp" Target="[INSTALLDIR]MyApp.exe" WorkingDirectory="INSTALLDIR"/> <!-- v6要求显式声明KeyPath --> <RegistryValue Root="HKCU" Key="Software\MyApp" Name="DesktopShortcutInstalled" Type="integer" Value="1" KeyPath="yes"/> <!-- 关键修复 --> </Component> </StandardDirectory> <!-- 新增v6特性:ARM64支持 --> <Condition Message="本安装包仅支持ARM64架构"> <![CDATA[Installed OR (VersionNT >= 1000)]]> <!-- 条件语法优化 --> </Condition> </Product> </Wix> D:\QuickStart>dotnet build 还原完成(0.3) QuickStart 失败,出现 1 错误 (1.5 秒) D:\QuickStart\Packge.wxs(24): error WIX0104: Not a valid source file; detail: The 'Product' start tag on line 10 position 4 does not match the end tag of 'StandardDirectory'. Line 24, position 7. 在 2.1 秒内生成 失败,出现 1 错误 帮我解决这个错误,而且我不是armx64,而是x64
07-29
若要使用 WiX 工具集创建第一个安装包,只需要一个文本编辑器和 .NET SDK。如果你有 Visual Studio 2022,则两者兼而有之。 打开命令提示符并执行以下步骤。 为您的第一个 WiX 项目创建一个新目录。 C:\> md C:\src\QuickStart cd C:\src\QuickStart 创建一个新的文本文件作为名为 QuickStart.wixproj 的 WiX 项目文件,其中包含以下内容。 快速入门.wixproj <Project Sdk="WixToolset.Sdk/6.0.0"> </Project> 创建一个名为 Package.wxs 的新 WiX 源文件,其中包含以下内容。 包.wxs <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> <Package Id="AcmeCorp.QuickStartExample" Name="QuickStart Example" Manufacturer="ACME Corp" Version="0.0.1"> <File Source="example.txt" /> </Package> </Wix> 创建一个名为 example.txt 的新文本文件,其中包含您想要的任何内容。 example.txt This is example.txt. It's just example data. 生成项目。 C:\src\快速入门> dotnet build 这是wix官方文档给出的教程,我将完全遵循这个教程来写,仅仅是wxs文件内容不同,以下是我的wxs文件内容: <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://wixtoolset.org/schemas/v6/wxs"> <Package InstallerVersion="600" Compressed="yes" InstallScope="perMachine" Platform="x64" Manufacturer="MyCompany"/> <Product Id="*" Name="MyApp" Language="1033" Version="1.0.0.0"> <!-- 目录结构 --> <StandardDirectory Id="ProgramFiles64Folder"> <Directory Id="INSTALLDIR" Name="MyApp"> <Component> <File Source="MyApp.exe" /> </Component> </Directory> </StandardDirectory> <!-- 快捷方式 --> <StandardDirectory Id="DesktopFolder"> <Component> <Shortcut Id="DesktopShortcut" Name="MyApp" Target="[INSTALLDIR]MyApp.exe" WorkingDirectory="INSTALLDIR"/> <RegistryValue Root="HKCU" Key="Software\MyApp" Name="DesktopShortcutInstalled" Type="integer" Value="1" KeyPath="yes"/> </Component> </StandardDirectory> <!-- 添加主功能组件 --> <Feature Id="MainFeature" Title="Main Feature" Level="1"> <ComponentRef Id="ProductComponent" /> <!-- 需要为INSTALLDIR组件添加ID --> <ComponentRef Id="DesktopShortcutComponent" /> <!-- 需要为快捷方式组件添加ID --> </Feature> </Product> </Wix> 现在报错:D:\QuickStart>dotnet build 还原完成(0.3) QuickStart 失败,出现 1 错误 (1.5 秒) D:\QuickStart\Packge.wxs(24): error WIX0104: Not a valid source file; detail: The 'Product' start tag on line 10 position 4 does not match the end tag of 'StandardDirectory'. Line 24, position 7.,请你帮我解决,输出修改过后的完整代码,不要省略代码
07-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值