سؤال

يساعد!أحتاج إلى تنفيذ إجراء مخصص مُدار في مشروع إعداد Wix 3.5 الخاص بي، وبغض النظر عما حاولت، لا يمكنني تشغيله.

أنا أستخدم التكامل Votive في Visual Studio 2010.لم يتغير ملف Wix Product.wxs بشكل أساسي عن قالب الاستوديو المرئي باستثناء بعض التغييرات النصية:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="666ffc07-90b2-4608-a9f0-a0cc879f2ad0" Name="Product Name" Language="1033" Version="5.5.0002" Manufacturer="TiGra Astronomy" UpgradeCode="d17a5991-b404-4095-9e93-08d2db984cfd">
    <Package InstallerVersion="200" Compressed="yes" />

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLLOCATION" Name="Directory Name">
                <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
                <!-- <Component Id="ProductComponent" Guid="3ea5ade7-9b7b-40da-9e83-13e066a000ef"> -->
                    <!-- TODO: Insert files, registry keys, and other resources here. -->
                <!-- </Component> -->
            </Directory>
        </Directory>
    </Directory>

    <Feature Id="ProductFeature" Title="ASCOM Driver" Level="1">
        <!-- TODO: Remove the comments around this ComponentRef element and the Component above in order to add resources to this installer. -->
        <!-- <ComponentRef Id="ProductComponent" /> -->

        <!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. -->
        <ComponentGroupRef Id="Product.Generated" />
    </Feature>
</Product>

لقد قمت بتعيين مرجع لمشروع الإجراء المخصص المُدار الخاص بي، وقم بتعيين خاصية HARVEST على true.المشروع يسمى WIX.CustomActions وينتج WIX.CustomActions.dll و WIX.CustomActions.CA.dll

أرى أن Wix يقوم بمعالجة المرجع أثناء الإنشاء و WIX.CustomActions.dll يظهر التجميع في الجدول الثنائي في مشروع الإعداد النهائي، ولكن WIX.CustomActions.CA.dll لا.

انا املك CustomActions.wxs يجب أن يقوم بتعبئة الإجراء المخصص واستدعاءه:

    <?xml version="1.0" encoding="UTF-8" ?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <Binary Id="DriverRegistrationCA" SourceFile="$(var.WIX.CustomActions.TargetDir)\$(var.WIX.CustomActions.TargetName).CA.dll" />
    <CustomAction Id="RegisterDriver" BinaryKey="DriverRegistrationCA" DllEntry="RegisterAscomDriver" Execute="deferred" Return="check" />
    <CustomAction Id="UnregisterDriver" BinaryKey="DriverRegistrationCA" DllEntry="UnregisterAscomDriver" Execute="immediate" Return="check" />
    <InstallExecuteSequence>
      <Custom Action="RegisterDriver" After="InstallFinalize" />
      <Custom Action="UnregisterDriver" Before="RemoveFiles" />
    </InstallExecuteSequence>
  </Fragment>
</Wix>

لقد ألقيت نظرة على مصادر "كيفية" مختلفة على شبكة الإنترنت وكانت في أحسن الأحوال مربكة، مع نصائح متناقضة.كما أفهمها، WIX.CustomActions.CA.dll الملف عبارة عن ملف dll غير مُدار يقوم بتحميل إطار عمل .NET ويمرر التحكم إلى الإجراء المخصص المُدار "الحقيقي".ومع ذلك، WIX.CustomActions.CA.dll لا يتم تعبئتها في ملف MSI الخاص بي.لقد اتبعت الأمثلة بأفضل ما أستطيع ولكن لا أستطيع رؤية ما هو الخطأ.

من فضلك، هل قام أي شخص بهذا العمل في Votive؟هل يمكنك أن تعطيني مثالاً عمليًا فعليًا؟

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

المحلول

أنت بحاجة إلى مرجع (على سبيل المثال، CustomActionRef) من منتجك إلى الجزء؛وإلا فسيتم تجاهله بواسطة الرابط الذكي.

نصائح أخرى

بناءً على اقتراح Bob Arnson، قمت بإضافة السطرين التاليين بالقرب من أعلى ملف Product.wxs الخاص بي:

<CustomActionRef Id="RegisterDriver"/>
<CustomActionRef Id="UnregisterDriver"/>

ويبدو أن فعلت الحيلة.يُظهر Orca الآن أن لدي جدول ثنائي يحتوي على CA dll الخاص بي وإدخال CustomAction في InstallExecuteSequence.

لم يذكر أي من الأمثلة التي وجدتها على الويب هذا المطلب.أعتقد أن الناس كانوا يتلقون الحكمة من خلال إعادة التدوير مع القليل من الفهم أو عدم الفهم.إذن ها هي الإجابة، شكرًا لبوب!

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