WiX:有自定义ProgressDlg的样本吗?

时间:2018-04-02 09:41:28

标签: wix windows-installer

Wix 3.10

在我为Windows Server角色和功能制作安装程序之后 (Wix: Cannot call DISM from Wix CustomAction) ,我的上级有几个反馈意见:

    <CustomAction Id='AddDISMComponent1' Property='DISMComponent1' Value='"[System64Folder]dism.exe" /norestart /quiet /online /enable-feature /FeatureName:IIS-WebServerRole /all /Source:[SXSFOLDER]' Execute='immediate'/>
    <CustomAction Id="DISMComponent1" BinaryKey="WixCA" DllEntry="CAQuietExec64" Execute="deferred" Return="check" Impersonate="no" />

    <CustomAction Id='AddDISMComponent2' Property='DISMComponent2' Value='"[System64Folder]dism.exe" /norestart /quiet /online /enable-feature /FeatureName:IIS-RequestFiltering /all /Source:[SXSFOLDER]' Execute='immediate'/>

    ~Snip~

    <InstallExecuteSequence>
      <Custom Action="AddDISMComponent1" After="CostFinalize" />
      <Custom Action="AddDISMComponent2" After="AddDISMComponent1" />

    ~Snip~
      <Custom Action="DISMComponent1" After="InstallInitialize"><![CDATA[(NOT Installed)]]></Custom> 
      <Custom Action="DISMComponent2" After="DISMComponent1"><![CDATA[(NOT Installed)]]></Custom> 

    </InstallExecuteSequence>  

其中一个反馈是,几个DISM安装顺序需要很长时间(在我的测试环境中大约需要5到10分钟) 尽管上面的标准WixUI_FeatureTree中的原始ProgressDlg没有显示当前的CA执行, 状态为空....当第一个CA启动时,进度条已经达到满。

所以我做了一个CustomizedProgressDlg,它有“ActionData”控件而不是“ActionText”(https://www.firegiant.com/wix/tutorial/user-interface-revisited/is-this-progress/)我还没有图像如何在CA执行时完成“ActionData”。

我有Csharp示例代码,它返回ProgressDlg ActionData(Wix, show custom status message in ProgressDlg),但是如何直接从wxs中的QuietExec中执行此操作...这样的自定义ProgressDlg是否有任何好的示例?

有什么想法吗?

P.S 我将progresstext添加到显示当前CA工作的安装程序,但仍然是进度条到达终点...我返回到ActionText。

CustomizedProgressDlg.wxs

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI>
            ~Snip~
        </Dialog>

            ~Snip~

            <Control Id="ActionText" Type="Text"
                X="70" Y="100" Width="285" Height="30">
                <Subscribe Event="ActionText" Attribute="Text" />
            </Control>
            <Control Id="ProgressBar" Type="ProgressBar" X="20" Y="115" Width="330" Height="10" ProgressBlocks="yes" Text="!(loc.ProgressDlgProgressBar)">
                <Subscribe Event="SetProgress" Attribute="Progress" />
            </Control>
            <Control Id="StatusLabel" Type="Text" X="20" Y="100" Width="50" Height="10" Text="!(loc.ProgressDlgStatusLabel)" />
        </Dialog>

            <InstallUISequence>
                <Show Dialog="CustomizedProgressDlg" Before="ExecuteAction" Overridable="yes" />
            </InstallUISequence>


            <ProgressText Action="DISMComponent1">Configuring DISMComponent1... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent2">Configuring DISMComponent2... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent3">Configuring DISMComponent3... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent4">Configuring DISMComponent4... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent5">Configuring DISMComponent5... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent6">Configuring DISMComponent6... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent7">Configuring DISMComponent7... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent8">Configuring DISMComponent8... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent9">Configuring DISMComponent9... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent10">Configuring DISMComponent10... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent11">Configuring DISMComponent11... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent12">Configuring DISMComponent12... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent13">Configuring DISMComponent13... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent14">Configuring DISMComponent14... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent15">Configuring DISMComponent15... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent16">Configuring DISMComponent16... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent17">Configuring DISMComponent17... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent18">Configuring DISMComponent18... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent19">Configuring DISMComponent19... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent20">Configuring DISMComponent20... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent21">Configuring DISMComponent21... (this may take a few minutes)</ProgressText> 
            <ProgressText Action="DISMComponent22">Configuring DISMComponent22... (this may take a few minutes)</ProgressText> 

            </UI>
    </Fragment>
</Wix>

ProgressBar reaches max

1 个答案:

答案 0 :(得分:0)

您可以做的最好的事情是根据报告进度的自定义操作使用某些内容,例如:

http://microsoft.public.platformsdk.msi.narkive.com/1THI13Xw/installmessage-progress

和MsiProcessMessage调用。您需要从自定义操作执行DISM调用。

然而,您所面临的问题无法得到妥善解决,因为您的示例只有两次DISM操作,如果每次操作需要5分钟,那么您就没有进展, 5分钟后完成一半,10分钟后完成。如果你有很多DISM调用显然会变得更好,但无论哪种方式,关键是从你自己单独的自定义操作运行它们,将自己的进度发送到标准进度条。

我不清楚客户对此级别的操作系统功能控制感到满意。我不了解您的客户群,但我所知道的大多数客户(尤其是那些拥有公司锁定系统的客户)都会对IIS的添加感到非常恼火。

相关问题