MSI / WIX - Affectation de GUID de composant lors de la transformation de plusieurs instances

StackOverflow https://stackoverflow.com/questions/5046712

  •  15-11-2019
  •  | 
  •  

Question

Utiliser WIX 3.5, j'ai un MSI avec une instance Transforms me permettant d'installer le logiciel sur la même machine avec différents noms de produits. Pour ce faire, j'ai une liste "codée dur" d'ID de produit et de noms dans le fichier .wxs défini sous condition. Cependant, je n'ai que la définition unique des fonctionnalités de fonctionnement de fonctionnement qui comprend à la fois des ressources de fichier et de fichiers.

L'installation semble fonctionner correctement, mais la désinstallation des instances démontre le comportement mentionné dans ces deux sources:

http://msdn.microsoft. com / fr-nous / bibliothèque / aa367797 (v= vs.85) .aspx

et

http://windows-installer-xml-wix-toolset.687559.n2.nfabababebobe.com/multiple-instance-Transforms-walkthrough-proposed-Simple -Anddition-to-Wix-to-To-THI-WIXIER-TD708828.HTML

Spécifiquement, aucune des ressources non-fichiers (dans ce cas, les entrées de registre) ne sont désinstallées, enregistrez la dernière instance de mon application. (c'est-à-dire si je désinstallez dans cette commande: instance1, instance2 et instance3 - Seules les ressources autres que les fichiers d'instance3 sont supprimées.

Je suppose que cela est associé à ne pas avoir la DIP unique pour les composants non fournis (alors que ce n'est pas un problème pour les composants de fichiers)

Alors, je me demandais si une approche valide serait de définir un seul fichier .WXS avec un seul identifiant, nom et un ensemble de fonctionnalités, mais une bootstrapper personnalisée générerait de nouveaux guidologs pour les composants du produit et des fichiers qui puis être inséré dans la base de données MSI au moment de l'exécution? I.e., alors quand il est temps de désinstaller ou de mettre à jour, je interrogerais le registre des instances installées et récupérerais leurs GUDR.

Cela permettrait de créer des occurrences au moment de l'exécution plutôt que sur le code papier dans les .wx à l'avance et d'être désinstallé proprement.

Est-ce que cela a du sens? Va brûler rendre tout mieux? :)

Était-ce utile?

La solution

As of version v3.6.1511.0, there is now a "MultiInstance" attribute for components. This allows a guid to be generated on the fly for each instance as per Josh Rowes suggestion in his post to the WiX mailing list (see the link in the OP). I have tested and this works correctly to cause registry data to be removed when the current instance is uninstalled, and not when the LAST instance is uninstalled.

Autres conseils

You don't need to have unique component ID's but you do need to have unique registry keys. Check out:

Authoring Multiple Instances with Instance Transforms

The article mentions:

To keep the nonfile data of each instance isolated, the base package should collect nonfile data into sets of components for each instance. The appropriate components should then be installed based on conditional statements that depend on the instance identifier.

I actually don't know what they are talking about there. I created n-Tier multiple instance installers where all the files were isolated by unique INSTALLDIR ( type 51 custom action at runtime to mutate the destination based on the InstanceID ) and all the registry data was mutated using the InstanceID as part of the path as mentioned in the article. I supported up to Sixteen unique instances with unique configuration data and unique version #'s ( each instance could be serviced via major upgrade apart from the other instances. ) All of this was to support a SaaS deployment model for an nTier application and I never ever had to create components with unique GUIDS and/or Conditional expressions.

The only thing wonky I had to do was on the client side they wanted a Shortcut on the desktop. (The Client supported multiple instances also because a site might have v1.0 in Production and v1.1 in Test )

Because I couldn't mutate the folder name (fixed) and because MSI's ShortCut table doesn't support formattable, I had to write a custom action to author the ShortCut dynamically at install table using the InstanceID into a TEMP table and then MSI created the shortcut for me.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top