MSI / WIX - Asignación de guías de componentes durante las transformaciones de múltiples instancias

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

  •  15-11-2019
  •  | 
  •  

Pregunta

Uso de WIX 3.5, tengo un MSI con las transformaciones de instancia que le permiten instalar el software en la misma máquina con los diferentes nombres de productos. Para hacer esto, tengo una lista de identificación de productos y nombres de "codificación dura" en el archivo .wxs definido condicionalmente. Sin embargo, solo tengo la definición de características únicas que incluye tanto los recursos de archivos como no archivos.

La instalación parece funcionar bien, pero la desinstalación de las instancias demuestra el comportamiento mencionado en estas dos fuentes:

http://msdn.microsoft. COM / EN-EEUU / Library / AA367797 (V= vs.85) .aspx

y

http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/multiple-instance-transforms-walkthrough-proposed-simple -Adición-a-wix-to-make-ellos-faceier-td708828.html

Específicamente, ninguno de los recursos no de archivo (en este caso, entradas de registro) se desinstala, guarde la última instancia de mi solicitud. (es decir, si desinstale en este orden: instance1, instance2 y instancia3, solo se eliminan los recursos no archivos de la instancia3.

Supongo que esto está relacionado con no tener GUID únicos para los componentes sin archivos (mientras que esto no es un problema para los componentes de archivos)

Entonces, me preguntaba si un enfoque válido sería definir un solo archivo .wxs con una identificación de producto, nombre y un conjunto de características, pero haz que un bootstrapper personalizado genere nuevos GUID para los componentes del producto y no archivos que ¿Luego se inserta en la base de datos MSI en Runtime? I.E., luego, cuando llegue el momento de desinstalar o actualizar, consultaría el registro para instancias instaladas y recuperaría sus GUIDs.

Esto permitiría que se creen instancias en tiempo de ejecución en lugar de con codificación dura en el .wxs con anticipación y se desinstalarán limpiamente.

¿Eso tiene sentido? ¿Quemará hacer todo mejor? :)

¿Fue útil?

Solución

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.

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top