We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

craig27527
Posts: 5
Joined: Tue Feb 07, 2017 9:27 pm

How to access xml file from custom action dll

I have a custom action dll that needs read from two xml files to be able to set several msi set property flags for the installer to use for custom actions. I have added my two xml files as temporary files, my question what location do I use to read the xml files from? Is it correct that they are stored in the Windows Temp directory? Have they already been copied to the disk before the validation dll is called?

Thanks!!!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to access xml file from custom action dll

Hello,

The temporary files are copied on target machine during the "Paths Resolution -> CostFinalize" standard action and it is removed during the "Finish Execution -> InstallFinalize" standard action.

So, in "Custom Actions" page you should add your validation dll custom action after the "Wizard Dialogs Stage -> Paths Resolution" action group. Then while keeping the [SHIFT] key pressed you should drag and drop it under the "Installation Execution Stage -> Paths Resolution" action group. This way the custom action will be shared between during both execution stage (the UI and the Installation one). The Wizard stage is executing only when the main installation runs with Full UI.

Also, under the "Execution Stage Condition" section you should click on the "Advanced execution scenarios..." hyperlink and enable the "Skip action in Install Execution Stage if Dialogs Stage used the same process" option. This way the custom action will be executed only during the Wizard stage when the installation runs with full UI and in the Installation stage when not executing with Full UI.

In what regards the path of the temp files, this is stored in their associated property. Just go to "Files and Folders" page, double click on the temp file and check its property. You can get the above property value from your custom action DLL code to get the temp file path at install time.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”