简体   繁体   中英

WIX installer: set additional text to exit dialog using custom action

I am installing ASP.NET MVC website using wix. I need to show the URL of installed site on the exit screen.

I have following properties:

<Property Id="WEBSITE_URL" Value="NotSet" />
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="NotSet" />

Which are populated using custom actions:

<CustomAction Id="GetWebsiteUrl"
              BinaryKey="CustomActions"
              DllEntry="GetWebsiteUrl"
              Execute="immediate"
              Return="ignore" />

<CustomAction Id="SetExitDialogAdditionalText"
              Property="WIXUI_EXITDIALOGOPTIONALTEXT" 
              Value="The API may be accessed from the following URL: [WEBSITE_URL]"/>

InstallUISequence is following:

<InstallUISequence>
      <Custom Action='GetWebsiteUrl' Before='ExecuteAction'>NOT Installed AND NOT REMOVE</Custom>
      <Custom Action="SetExitDialogAdditionalText" After="GetWebsiteUrl">NOT Installed AND NOT REMOVE</Custom>
</InstallUISequence>

And the result string on exit screen is:

The API may be accessed from the following URL: NotSet

I've tried to execute custom actions in the InstallExecuteSequence and in the logs I can see that string looks correct:

<InstallExecuteSequence>
      <Custom Action='GetWebsiteUrl' Before='InstallFinalize'>NOT Installed AND NOT REMOVE</Custom>
      <Custom Action="SetExitDialogAdditionalText" After="GetWebsiteUrl">NOT Installed AND NOT REMOVE</Custom>
</InstallExecuteSequence>

The result in logs:

PROPERTY CHANGE: Modifying WEBSITE_URL property. Its current value is 'NotSet'. Its new value: ' http://localhost:80 '.

PROPERTY CHANGE: Modifying WIXUI_EXITDIALOGOPTIONALTEXT property. Its current value is 'NotSet'. Its new value: 'The API may be accessed from the following URL: http://localhost:80 '.

But in UI something is going wrong. I feel like the problem is in the InstallUISequence, but can't understand what I'm doing wrong. Please advise.

如果未在UI和执行序列中正确保存值,请尝试将WEBSITE_URL属性声明为安全。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM