Passing $appName to AppDeployToolkitConfig.xml

//Passing $appName to AppDeployToolkitConfig.xml
Passing $appName to AppDeployToolkitConfig.xml 2015-04-20T03:32:06+00:00

The Toolkit Forums General Passing $appName to AppDeployToolkitConfig.xml

  • Author
    Posts
  • WaiYin
    Participant
    Post count: 3
    #133 |

    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

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    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.

  • WaiYin
    Participant
    Post count: 3

    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

  • Muhammad Mashwani
    Keymaster
    Post count: 118

    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)
  • WaiYin
    Participant
    Post count: 3

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

    And it was so simple to implement this.

    WaiYin

You must be logged in to reply to this topic.