Messagebox displaying install state? - Advanced Installer Community

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!

BGood
Posts: 32
Joined: Thu Apr 19, 2012 4:22 pm

Messagebox displaying install state?

I am trying to build an installer which will install files depending upon products which are already installed? Similar to the following scenario:

If Product ABC is already installed, then install File ABC
or
If product DEF is installed, then install File DEF

The install directory in each case would be withing the [APPDIR] structure of the earlier installation. So I need to identify whether Product ABC or DEF is installed, read the appropriate [APPDIR] value, and copy the installer payload to the right place in the [APPDIR] folder hierarchy.

And I would like to report the results in a messagebox, before doing anything. Something like "Product ABC (is/is not) already installed" "Product DEF (is/is not) already installed" "Do you want to proceed?"

How do I do this with an AI Professional license? I can't seem to even get the basic messagebox to display.

Thanks
BGood
Posts: 32
Joined: Thu Apr 19, 2012 4:22 pm

Re: Messagebox displaying install state?

Update: I now have the messagebox display, but how do I set the conditional based on the product installed?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Messagebox displaying install state?

Hello,

In order to achieve what you want you can save your ABC/DEF software installation path into a registry value. Then, when installing the main application you can search for the related registry value containing the ABC/DEF software installation path and, then install the desired resource files accordingly.

Here's the steps to proceed:
- When creating your ABC installation project go to "Registry" page, select the "HKEY_LOCAL_MACHINE\Software\[Manufacturer]\[ProductName]" registry key and add the following registry value:
  • Name: Path
    Type: REG_SZ
    Data: "[APPDIR]"
- Repeat the above step for your DEF installation project.
- Create your main installation project.
- Go to "Search" page and add a "New Search" (i.e. ABC_PATH) using [New Search] toolbar button. Select "ABC_PATH" search and from its context menu choose "Add Location -> Registry". In the "Registry Location Properties" right pane set the following:
  • Root: HKEY_LOCAL_MACHINE
    Key: SOFTWARE\ABCManufacturer\ABCProductName
    Name: Path
    Type: The value contains a path to a directory
- Add another "New Search" (i.e. DEF_PATH) using [ New Search ] toolbar button. Select "DEF_PATH" search and from its context menu choose "Add Location -> Registry". In the "Registry Location Properties" right pane set the following:
  • Root: HKEY_LOCAL_MACHINE
    Key: SOFTWARE\DEFManufacturer\DEFProductName
    Name: Path
    Type: The value contains a path to a directory
- Go to "Files and Folders" page and create a property based folder using "New Folder -> Property Based" context menu option. In the "Property Picker" dialog select the "ABC_PATH". Here add the related "File ABC".
- Go to "Organization" page, select the related "File ABC" component and in the "Component Properties" right pane set the "Condition" field to: ABC_PATH
- Repeat the above steps for the related "File DEF".
- Build and run your project.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
BGood
Posts: 32
Joined: Thu Apr 19, 2012 4:22 pm

Re: Messagebox displaying install state?

Thanks for the detailed instructions, Daniel. Iwill give it a try.
BGood
Posts: 32
Joined: Thu Apr 19, 2012 4:22 pm

Re: Messagebox displaying install state?

Hi Daniel,

First of all, I would like to thank you for the step-by-step instructions.

In contrast to support answers which assume I have mastered Windows Installer terms of art and the special vocabulary of Windows Installers, your response was much easier to follow and I think I have most of the script handled.

Regarding the user messagebox, I still would like to inform the user about the actions taken. When you say:
- Go to "Organization" page, select the related "File ABC" component and in the "Component Properties" right pane set the "Condition" field to: ABC_PATH
Does this mean if [ABC_PATH] is nothing, then the file does not get copied? Can this same type of condition be used with the messagebox so that an affirmative messagebox is displayed if the path was found and a that a failed messagebox is displayed if the path was not found?

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

Re: Messagebox displaying install state?

Hello,
Does this mean if [ABC_PATH] is nothing, then the file does not get copied?
Yes, you're right.
Can this same type of condition be used with the messagebox so that an affirmative messagebox is displayed if the path was found and a that a failed messagebox is displayed if the path was not found?
Yes. In order to achieve this you can use the following condition for your affirmative message box custom action:
  • ABC_PATH
and the following condition for your failed message box custom action:
  • NOT ABC_PATH

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

Return to “Common Problems”