Wix组件GUID"*"对此组件无效 [英] Wix component GUID "*" is not valid for this component

查看:258
本文介绍了Wix组件GUID"*"对此组件无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过自动为 AppData(按用户安装)下安装的同一文件夹中的多个组件的GUID来解决我的问题.

I'm trying to solve my issue with autogerating GUID for multiple components in same folder installed under AppData (per-user installation).

在编辑之前,我只有一个组件包含3个文件.然后,我决定对该组件使用自动GUID,因此我将其分为3个组件(每个都有一个文件).我以为现在可以使用Component GUID with *registry value with KeyPath=yes了,但是它不起作用.任何建议都非常感谢.

Before edit I had one component with 3 files. Then I've decided to use auto GUID for this component, so I have divided it into 3 component (each with one file). I thought that now I can use Component GUID with * and registry value with KeyPath=yes but it's not working. Any advice is very appreciated.

这是代码段:

<Directory Id='INSTALLDIR' Name='$(var.myInstallDir)'>

        <Component Id='MainExecutable' Guid='I_WOULD_LIKE_ASTERISK_HERE_ALSO_BUT_HAVE_HARD_CODED_GUID' >

          <RemoveFolder Id='RemoveINSTALLDIR' Directory='INSTALLDIR' On='uninstall' />
          <util:RemoveFolderEx On="uninstall" Property="APPLICATIONFOLDER" /> 

          <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Name='Path' Value='[INSTALLDIR]'  KeyPath='yes'/>

          <File Id='ffile1' Name='file1' DiskId='1' Source='file1'> </File>

          <Shortcut Id="startmenujfile" Directory="ProgramMenuDir" Name='$(var.myAppName)'
          Target="[SystemFolder]cmd.exe" Arguments=" /c START javaw.exe -jar [INSTALLDIR]file1.jar ."
          WorkingDirectory="INSTALLDIR"
          Icon="apsoiconmultiico" IconIndex="0" /> 

          <Shortcut Id="desktopjfile" Directory="DesktopFolder" Name='$(var.myAppName)'
          Target="[INSTALLDIR]file1.jar" Arguments=" ."
          WorkingDirectory="INSTALLDIR" 
          Icon="iconmultiico" IconIndex="0" /> 

        </Component>

        <Component Id='MainExecutable2' >
          <File Id='ffile2' Name='file2' DiskId='1' Source='file2' />
          <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes'/>
        </Component>

        <Component Id='MainExecutable3' >
          <File Id='ffile3' Name='file3' DiskId='1' Source='file3' />
          <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes'/>
        </Component>
      </Directory>

以及组件错误:

 error CNDL0230 : The Component/@Guid attribute's value '*' is not valid for this component because it does not meet the criteria for having an automatically generated guid. Components with registry keypaths and files cannot use an automatically generated guid. Create multiple components, each with one file and/or one registry value keypath, to use automatically generated guids.

谢谢

感谢@SteinÅsmul的回答.我需要再问一次..

Thanks to @Stein Åsmul answer. I need to ask one more time..

我正在尝试解决此问题,因为我们正从Java Web Start(jnlp)转向非常简单的.msi文件,该文件仅安装基本文件和快捷方式.然后,应用程序本身具有自动更新系统,该系统会下载所有其他文件.

I'm trying to solve this because we are moving from Java Web Start (jnlp) to very simple .msi file which installs only elementary files and shortcuts. Then the app itself has automatical update system which downloads all other files.

我们的应用程序可以在同一台计算机上安装多套版本"(例如A组:"app 1演示,app 2测试"和B组:"app 2演示,app 2测试").每个集合和集合中的每个版本都可以有不同的文件(这是更新系统本身的工作).

Our app can have "mupliple sets of versions" installed on same machine (like set A: "app 1 demo, app 2 test" and set B: "app 2 demo, app 2 test"). Every set and every version in the set can have different files (this is a job for update system itself).

现在是问题.我是.msi安装的新手,因此不确定很多步骤.我知道productId,upgradecode ..但是在同一台计算机上安装了多套应用程序(按用户但不同目录-AppData/local/setA和AppData/local/setB)的环境中的组件GUID(在我的情况下为Component Id='MainExecutable')呢? ),并带有注册表KeyPath = yes?如果productId不同(对于所有安装,都用.wxs硬编码),那么此组件可以为我们所有的安装具有固定的GUID吗?谢谢您的解释.

Now the question. I'm a newbie in .msi installation so I'm not sure about many steps. I know productId, upgradecode.. but what about component GUID (in my case Component Id='MainExecutable') in enviroment with multiple sets of app installed on same machine (per-user but different directory - AppData/local/setA and AppData/local/setB) with registry KeyPath=yes? Can this component has fixed GUID for all our installations if productId is different (so hardcoded in .wxs for all installations)? Thank you for explanation.

推荐答案

简短答案 : You cannot use auto-guids for components that have the same / non-unique key path - which is the case for per-user registry key paths .更简单的方法:将文件安装到每台计算机上,然后在应用程序启动时将它们复制到每个用户配置文件中,而不是 通过MSI为每个用户安装它们.这将解耦所有用户配置文件 常见的部署问题(覆盖/重置,升级问题,卸载问题等). 每台机器的按键路径可以使用自动导航-每个组件都是唯一的.

Short Answer: You cannot use auto-guids for components that have the same / non-unique key path - which is the case for per-user registry key paths. Simpler approach: Install files to a per-machine location and copy them into each user-profile on application launch instead of installing them per-user via an MSI. This de-couples all user-profile files from common deployment problems (overwriting / resetting, upgrade problems, uninstall problems, etc...). Auto-Guids are possible for per-machine key paths - they are unique per component.

每用户密钥路径 : HKCU\Software\Company\Product\MyKeyPath

Per-User Key Path: HKCU\Software\Company\Product\MyKeyPath

  • 为每个用户重复! =>无法自动引导.它不是唯一的.
  • 用户1 : C:\Profiles\User1\Product\File.exe 密钥路径 : HKCU\Software\Product\MyKeyPath
  • 用户2 : C:\Profiles\User2\Product\File.exe 密钥路径 : HKCU\Software\Product\MyKeyPath
  • Repeats for every user! => No auto-guid possible. It is not unique.
  • User 1: C:\Profiles\User1\Product\File.exe, Key path: HKCU\Software\Product\MyKeyPath
  • User 2: C:\Profiles\User2\Product\File.exe, Key path: HKCU\Software\Product\MyKeyPath

作为记录,如果您设置一个基于磁盘的用户配置文件基于密钥的路径(而不是您应该使用的注册表项路径),则会发生以下情况: 彩色插图

For the record, here is what would happen if you set a userprofile disk-based key-path (as opposed to a registry key path which you are supposed to use): Color illustration.

每个计算机的密钥路径 : C:\Program Files\Company\Product\Main.exe

Per-Machine Key Path: C:\Program Files\Company\Product\Main.exe

  • 只有一个安装实例!独特的键路径允许自动引导.

只读模板 :首先是一个普遍的问题:建议您不要将文件直接安装到用户配置文件文件夹中.而是应将它们安装到 Program Files 下的主安装文件夹中,然后在应用程序启动期间为使用该应用程序的每个用户将它们复制到位.然后可以根据需要并在应用程序启动时将文件复制到每个用户配置文件(

Read-Only Templates: A general issue first: it is recommended that you don't install files directly into the user profile folders. Rather you should install them to your main installation folder under Program Files and then copy them in place during application launch for every user who uses the application. The files can then be copied to every user-profile on demand and on launch of the application (upgrades are possible too, if you implement it well).

技术上 :对于具有相同/非唯一键路径的组件,不能使用自动导航.可以通过阅读以下旧答案来最好地理解技术原因:更改我的wix中的组件GUID吗?本质上,键路径必须唯一才能创建自动GUID,而按用户注册表键则不是这种情况.所有用户的路径都是相同的-指向相同的注册表项(即使每个用户的内容都不同). MSI技术的局限性.

Technically: You cannot use an auto-guid for components that has the same / non-unique key path. The technical reasons can perhaps be best understood by reading this old answer: Change my component GUID in wix? Essentially the key path must be unique in order to be able to create an automatic GUID, and this is not the case with per-user registry keys. The path is the same for all users - to the same registry key (even if the content is different for each user). A limitation of the MSI technology.

Note that if you install to a per-machine path you will be able to use auto-GUIDs since you can have a unique file key path for the component .这应该工作正常.只需将文件移动到每台机器的路径并设置自动引导.升级后的文件将覆盖较旧的文件,如果需要,您可以在启动时在用户配置文件中的文件上复制较新的文件.大多数情况下,操作风险很大.

Note that if you install to a per-machine path you will be able to use auto-GUIDs since you can have a unique file key path for the component. This should work fine. Just move the files to a per-machine path and set an auto-guid. Upgraded files will overwrite older files and you can copy newer files over the ones in the user profile on launch - if desirable. A risky operation most of the time.

:我喜欢基于云的方法,可直接从Internet或Intranet按需将文件下载到用户配置文件中,作为通过MSI部署的替代方法.这完全取决于您可以访问的内容.

Cloud: I am fond of cloud-based approaches to download files into the user profile on-demand directly from the Internet or Intranet as an alternative to deployment via MSI. It all depends what you have access to.

更多详细信息 :围绕相同点的现有答案太多,以至于没有任何价值可重写.请检查以下链接,以获取有关使用MSI部署每用户文件的更多详细信息:

More Details: There are too many pre-existing answers that revolve around the same points for there to be any value in rewriting it. Please check the below links for more details on the deployment of per-user files with MSI:

  • Create folder and file on Current user profile, from Admin Profile
  • Wix deferred custom action access denied
  • How to create nested folder in AppData
  • Create a .config folder in the user folder
  • Make WIX installer place files in AppData

这篇关于Wix组件GUID"*"对此组件无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆