MSI / WIX - ASSEGNARE IL GUID DEL CORPO DEL COMPONENT DURANTE TRANSFULture di istanza

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

  •  15-11-2019
  •  | 
  •  

Domanda

Usando Wix 3.5, ho un MSI con le trasformazioni di istanza che mi consente di installare il software sulla stessa macchina con nomi di prodotti diversi. Per fare ciò, ho un elenco "hard-coded" di ID prodotto e nomi del file .wxs definito condizionatamente. Tuttavia, ho solo la definizione del singolo feature-componentref che include sia le risorse di file che non file.

L'installazione sembra funzionare bene, ma disinstallare le istanze dimostra il comportamento menzionato in queste due fonti:

http://msdn.microsoft. COM / IT-US / Biblioteca / AA367797 (V= VS.85) .aspx

e

http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/multiple-instance-transforms-walkthrough-proposed-simple -Addition-to-wix-to-make-theri-eashier-td708828.html

In particolare, nessuna delle risorse non file (in questo caso, le voci del registro) vengono disinstallate Salva l'ultima istanza della mia applicazione. (I.e., Se disinstalla in questo ordine: Istanza1, Istanza2 e Istanza3 - Solo le risorse non file dell'istanza3 vengono rimosse.

Presumo che ciò sia correlato a non avere un GUID univoco per componenti nonfili (mentre questo non è un problema per i componenti dei file)

Allora, mi stavo chiedendo se un approccio valido sarebbe quello di definire un singolo file .wxs con un ID del prodotto, il nome e un set di funzioni, ma avere un bootstrapper personalizzato generano nuovi GUID per il prodotto e i componenti non file che Quindi viene inserito nel database MSI in runtime? I.e., quindi quando arriva il momento di disinstallare o aggiornare, interrogare il registro per le istanze installate e recuperare i propri guidti.

Ciò consentirebbe di creare esempi di essere creati in fase di esecuzione piuttosto che hardcoded in the .wxs in anticipo, e per essere disinstallato in modo pulito.

ha senso? Brucerà ogni cosa migliore? :)

È stato utile?

Soluzione

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.

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top