Passing $appName to AppDeployToolkitConfig.xml

Hi,

Is there a way to pass the variable $appName from into the XML file? We would like to customize the message for <ClosePrompt_Message> to show the application name but we don’t really want to hardcode the application name within the XML file.

Thanks in advance for the support. This had been a great tools for deploying software which required users attention.

Best regards
WaiYin

Look in the XML file at the following elements: Toolkit_TempPath, Toolkit_LogPath. They both reference variables defined in the toolkit itself.

If you look at the toolkit, you see that we read and expand the values of these elements using this method:
$ExecutionContext.InvokeCommand.ExpandString($xmlToolkitOptions.Toolkit_TempPath)

Do the same for your variable.

Hi,

Thanks for the reply.

I review the code you mention and it seem to be passing value from XML to Toolkit. Probably my question was not clear earlier, sorry about that.

In the Deploy-Application.ps1, there is a variable $appName. This is the variable which i would like to pass it into XML so that Show-InstallationWelcome can display the application name when it is called via <ClosePrompt_Message>.

Thanks and regards
WaiYin

No, I think I understand what you’re trying to do.

Take one of the examples I mentioned above: the Toolkit_TempPath element in the XML file.
This element has a defautt value of: $envSystemDrive\Users\Public

$envSystemDrive is a variable defined in AppDeployToolkitMain.ps1. So you can use the same method we did for this variable to pass $appName to the XML file.

It does mean that you will have to modify this line in AppDeployToolkitMain.ps1

[string]$configClosePromptMessage = $xmlUIMessages.ClosePrompt_Message

to

[string]$configClosePromptMessage = $ExecutionContext.InvokeCommand.ExpandString($xmlUIMessages.ClosePrompt_Message)

Thanks a lot. I got this figure out with the tips provided by you.

And it was so simple to implement this.

WaiYin