milanche
Posts: 14
Joined: Mon Sep 10, 2012 5:41 pm

Detect if prerequisite is installed by my Setup

Hello,

i have a setup project with one feature-based prerequisite (.NET framework v4).
I'm trying to detect did my setup installed this prerequisite during the process (It was missing from machine).

Idea is to show "Restart" options on finish dialog, only if .NET is installed now.
Image

I tried these conditions, but it seems they are always positive (it can't tell is .NET detected on the machine or installed now):

-Feature will be installed local. The feature is not reinstalled.
-Feature state: installed locally
-Component is being installed locally
-Component state: installed locally

One of the conditions code:

Code: Select all

(!AAFDE9CF_9E01_43FE_869C_F81D4708C0CF = 3)
Is this normal behavior or i'm doing something wrong?

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

Re: Detect if prerequisite is installed by my Setup

Hello,
i have a setup project with one feature-based prerequisite (.NET framework v4).
Please note that it is not recommended to add the .Net Framework prerequisite as a feature-based one and you can see here why does .NET Framework fails as feature-based prerequisite?
Idea is to show "Restart" options on finish dialog, only if .NET is installed now.
You can enable the Reboot system after installing this prerequisite option from the Prerequisite Properties Tab. The user will be prompted to reboot the machine after the prerequisite is installed. If the user accepts a reboot, the machine will be automatically restarted and the installation will continue, otherwise the installation will be aborted.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
milanche
Posts: 14
Joined: Mon Sep 10, 2012 5:41 pm

Re: Detect if prerequisite is installed by my Setup

Thanks, that worked. :)
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Detect if prerequisite is installed by my Setup

You're welcome,

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
milanche
Posts: 14
Joined: Mon Sep 10, 2012 5:41 pm

Re: Detect if prerequisite is installed by my Setup

Actually, i have. ;)

After i did only change in setup project, changed .NET prerequisite from Feature-based to Pre-install and enabled 'Reboot system after installing', some users (Win7/Win8) are getting this error while installation is in progress:
Image

Is it maybe familiar for you, and related to above change?

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

Re: Detect if prerequisite is installed by my Setup

Hello,

No, I don't think this error is related with the above changes.

Please note that when setting a folder's permissions for example you need to localize the user or group accounts as explain in the How do I localize user or group accounts? article.

Please let me know if the behaviour still persist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
milanche
Posts: 14
Joined: Mon Sep 10, 2012 5:41 pm

Re: Detect if prerequisite is installed by my Setup

Hello,

i found the reason, it was registry key permissions. So i removed that.
Image

I wanted to make sure user will be able to change registry values on a key like HKEY_CURRENT_USER/Software/MyProduct.
But because it's inside HKEY_CURRENT_USER, it should be fine without adding any permissions as above (because he must be Admin anyways to be able to install).

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

Re: Detect if prerequisite is installed by my Setup

You're welcome,

I'm glad you got this working.
If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”