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!

btech88
Posts: 5
Joined: Tue Mar 11, 2014 10:29 pm

Customized Install Process that updates XML file

We would like to customize the install process by:
1. Add a custom dialog right after the Folder Dialog (Folder dialog being the one that allows the user to change the default install directory. I know how to do this part.
2. We need to be able to retrieve the actual directory that the program was installed in. How can we get this value?
3. Have a conditional (show only if) for showing the custom dialog based in if the user selected the default install directory. If they did chose the default install directory then we want to show the custom dialog. Not sure how to do this?
4. We need to ask the user a question on the custom dialog and update a variable in an XML file based on their answer. I think you have native support for updating XML files? Not sure how to do this. Not sure how to retrieve response from custom dialog.
btech88
Posts: 5
Joined: Tue Mar 11, 2014 10:29 pm

Re: Customized Install Process that updates XML file

So after thinking about it a bit more, could I just create simple java app that does everything I need and just have the installer call it right after the Folder dialog box in the install sequence? This app would display a dialog box and handle all the tasks I listed above.

If so how I would bundle this simple java app along with the installer? Also could I retrieve the program installation path from Advanced Installer and pass it as a parameter to the java app?

Thanks
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Customized Install Process that updates XML file

Hello,
Add a custom dialog right after the Folder Dialog (Folder dialog being the one that allows the user to change the default install directory. I know how to do this part.
Select the FolderDlg from the Dialogs page and use the New Dialog toolbar button.
We need to be able to retrieve the actual directory that the program was installed in. How can we get this value?
Please note that the installation folder of the previos application is retrieved by the AI_RESTORE_LOCATION action during an upgrade. The folder’s path is stored in the APPDIR property.
So, do you perform an upgrade of an installation package which is build with Advanced Installer?
Have a conditional (show only if) for showing the custom dialog based in if the user selected the default install directory. If they did chose the default install directory then we want to show the custom dialog. Not sure how to do this?
In order to achieve that you can define a property in Install Parameters page which will contain the default installation path.
If the installation path has been changed, (e.g. the user selected a different installation folder than the default one in the FolderDlg) you can show the related dialog.
I’ve attached a sample which implements this scenario.
I’ve defined a property (DEF_PATH) in the Install Parameters page. In the Custom Actions page. I’ve added the predefined Set installer property custom action to set the property value with the default value of the APPDIR
If the user has selected a different installation folder, then I show the related dialog through the Show only if… condition(e.g. NOT (DEF_PATH=APPDIR) ).
You can take a look on the How do I conditionally show the "StartMenuShortcutsDlg" dialog? article which may be useful.
We need to ask the user a question on the custom dialog and update a variable in an XML file based on their answer. I think you have native support for updating XML files? Not sure how to do this. Not sure how to retrieve response from custom dialog.
This is possible through the XML Feature. Also, please take a look on the How do I import and edit a XML file? article which may be useful to you.

Please let us know if that helped.

Best regards,
Dan
Attachments
Your Application.zip
(3.96 KiB) Downloaded 247 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”