shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

How to determine if a user has a minimum version of DirectX?

Hi,
I've seen there's a way to determine if a user has a specific version of DirectX installed on the computer. But is there any way to determine a minimum version?
And another question. In the case that the user doesn't have the required version, how can I make the installer install the newest version during the installation process? I mean I want this to be checked between the dialogs, and when the copying of the files starts, DirectX to be installed together with the files in the package.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

This can be done with prerequisites. Switch to "Prerequisites" page, "Software" tab and add DirectX as prerequisite. Specify a URL from where to download it, also you can specify the "Minimum" version in the "Install Conditions" tab.

Read more about prerequisite here:
http://www.advancedinstaller.com/user-g ... tware.html

Hope this helps.

Best Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Hi again,
It helps to a certain degree. But I don't want the installation to check this as a condition to start. I want to check for the version during the installation (between the dialogs). May I achieve that?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Here is another suggestion:

Create a registry search in the "Search" page and browse for this key:
HKLM\Software\Microsoft\DirectX\Version

Create a new dialog in the "First Time Install" section of the "Dialogs" page. Under the "Next" button of the dialog scheduled in front of this new dialog add following published event:
Event: NewDialog
Argument: select the new added dialog
Condition: SEARCH_PROPERTY <> "9.0" (the requeried version of DirectX is not installed)

In this new added dialog you can explain to the user that the DirectX was not found and give him the option to install it or not (with a radio button for example).

Regarding the DirectX package you can add him as "New Attached Custom Action" under "InstallFinalize" standard action. Condition this custom action with:

Code: Select all

SEARCH_PROPERTY <> "9.0" AND ...
Replace the "..." with a condition reflecting what option the user selected in the new dialog.

Hope this helps. Please let me know if is something that you don't understand.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Hi,
The problem is that the value of this key is something like: "4.09.0000.0904". That's why it couldn't be done with a simple search. Can this value be converted into a number and compared with another number? I don't see any other way :(
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The condition that I used in my previous post is exclusive for 9.0 version of DirectX. If you want that dialog to not be displayed if for example a version greater than 9.0 is present use this condition:

Code: Select all

SEARCH_PROPERTY > "9.0" AND ...
To display other dialog use the opposite condition.

For a tutorial on how to display a dialog conditionally please see:
http://www.advancedinstaller.com/user-g ... ialog.html

Best Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

OK, thank you :)
shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Unfortunately another problem occured. If I make a new attached custom action, it will point to only one file. And DirectX installation consists of more than one file.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You can add all DirectX files as temporary files and use a "Launch File or Open Url" type of custom action.

But could you please tell me why you don't want to use prerequisites? A prerequisite is a software needed by your application prior to run and it's installed before your application.

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Couldn't I use the files from a folder in the root folder of the installation? I'm not sure if it's very clear in the above way, so I'll give an example :)
Let's say the disk drive is E:. The installation files are in E:\. Let's say the DirectX folder is in E:\DirectX. So could the installater take the files from this folder during the installation?
I have a question about the paths too. What does "absolute" mean? Can I for example choose an icon from the directory where the application should be installed?
I don't want to use prerequisites because if the software is installed, I don't want the user to see this window. And if it's possible I want to make the software to be installed only by dialogs.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
Couldn't I use the files from a folder in the root folder of the installation?
If you put the DirectX files in a folder next to the msi file then to launch the DirectX setup use a "Add Predefined Custom Action->Launch File or Open Url" type of custom action. In the "Command Line" field type: [SourceDir]\DirectX\Setup.exe (where [SourceDir] property gives the path where the msi resides).
I don't want to use prerequisites because if the software is installed, I don't want the user to see this window
The prerequisites dialog appear only if the prerequisite software is not already installed. If the "Bootstrapper" detects that a prerequisite software was not found on the target computer the prerequisites dialog appear and inform the user that some prerequisites are missing.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Thank you very much! :) That really helped me!

About the prerequisites, I don't want to use them, because their installation is not very customizeble (I can't make custom dialogs).
shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Hi and Happy New Year :)
I still have a problem with determining the DirectX version...
gigi wrote:Hi,

The condition that I used in my previous post is exclusive for 9.0 version of DirectX. If you want that dialog to not be displayed if for example a version greater than 9.0 is present use this condition:

Code: Select all

SEARCH_PROPERTY > "9.0" AND ...
To display other dialog use the opposite condition.
This doesn't really work, I tried several times, but it doesn't. Another way I tried by comparing the version with the string "4.09.0000.0904" and it worked. But when I reinstalled my operating system I noticed that my installation can't go on, because the registry key was "4.09.00.0904". I was thinking of using some variables to solve decide this, but I suppose AI doesn't support this. So I hope there's another solution for this problem.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

I test this and on my computer works fine. Are you sure that you use following conditions to display the dialogs:

Code: Select all

SEARCH_PROPERTY < "9.0"
Use this condition to display the dialog that inform the user to install the DirectX. The version that was found is smaller than 9.0. Your application requires 9.0 or greater.

Code: Select all

SEARCH_PROPERTY >= "9.0"
Use this condition to display other dialog. To continue the installation without installing the DirectX.

This is an example, if your application need other version of DirectX then change this condition to fit your needs.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
shadyfan
Posts: 45
Joined: Sat Nov 25, 2006 8:15 pm

Yes I'm sure about it. But how could it work, if the registry value is something like "4.09.0000.0904"? Is it a special option of AI?

Return to “Common Problems”