MSI / WIX - تعيين مكون GUID أثناء تحويل مثيل متعدد

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

  •  15-11-2019
  •  | 
  •  

سؤال

باستخدام WIX 3.5، لدي MSI مع تحويل مثيل يسمح لي بتثبيت البرنامج على نفس الجهاز بأسماء منتجات مختلفة. للقيام بذلك، لدي قائمة "بجد مشفرة" من معرف المنتج والأسماء في ملف .wxs المعرض بشكل مشروط. ومع ذلك، لدي فقط تعريف مائع واحد المكونات الواحدة التي تتضمن كل من الموارد والملف وغير الملفات. يبدو أن التثبيت

يعمل بشكل جيد، ولكن إلغاء تثبيت المثيلات يوضح السلوك المذكور في هاتين المصدرين:

href="http://msdn.microsoft.com/en-us/library/aa367797(V=VS.85).aspx" rel="nofollow noreferrer"> http://msdn.microsoft. com / en-us / library / aa367797 (v= vs.85) .aspx

و

http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/multiple-instance-transforms-walkthrough-proposed-simple -Addition إلى WIX-To-Make-Thers-There-TD708828.HTML

على وجه التحديد، لا يتم إلغاء تثبيت أي من موارد التسجيل (في هذه الحالة) حفظ مثيل آخر جدا من التطبيق الخاص بي. (أي، إذا قمت بإلغاء التثبيت في هذا الترتيب: مثيل، تتم إزالة موارد غير ملفات مثلي الحالة فقط.

أنا أفترض أن هذا يرتبط بعدم وجود مكونات GUID الفريدة ل Nonfile (في حين أن هذه ليست مشكلة لمكونات الملفات)

لذلك، كنت أتساءل عما إذا كان النهج الصالح هو تحديد ملف .wxs واحد مع معرف منتج واحد، واسم ومجموعة واحدة من الميزات، ولكن لديها Boottrapper مخصص لتوليد GUID الجديد لمكونات المنتج وغير الملفات التي ثم أدخلها في قاعدة بيانات MSI في وقت التشغيل؟ I.E.، ثم عندما يحين وقت إلغاء التثبيت أو التحديث، أود أن أستعلم التسجيل المثبتة المثبتة واسترداد GUIDs الخاصة بهم بعد ذلك.

هذا من شأنه أن يسمح بذلك المثيلات التي سيتم إنشاؤها عند وقت التشغيل بدلا من الصغار في .WXS مقدما، وأن يتم إلغاء تثبيتها نظيفة.

هل هذا معنى؟ سوف يحترق جعل كل شيء أفضل؟ :)

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top