0
votes

I'm using InstallShield 2009 and have to launch an executable when I click the 'Finish' button of the installation wizard.

So, to do this, I used custom action and it's working fine, but now, I have to make a verification before call this custom action. I have to verify if the .Net framework is installed, if true, don't execute if isn't installed execute.

Can anybody help?

Please let me know if anything isn't clear.

Thanks.

3
I forgot to tell that the .net version that I'm looking for is 4.0Leonardo Arruda
Leonardo, you keep asking the same question over and over but you are asking the wrong questions. We can't help you do things the wrong way.Christopher Painter
I can't help with InstallShield, so I don't post this as an answer, however I suppose you have same form of reading values in the registry. This path contains the info you require: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full. The key to read is Install, if you get 1 then you have NET Frameword istalled. Keep in mind that if on target machine there is the Client Profile installed you should check for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client. See Microsoft SupportSteve
But, add a search for this key is what I don't know. I need to make a function to return true or false if this key exits. But I don't know how to make it in InstallShield.Leonardo Arruda

3 Answers

1
votes

It seems like you want to install the FW if not present: Why don't you use a prerequisite?
See e.g. HERE for another question on that topic.

0
votes

You should be able to bundle the .NET redistributable with the installer, and execute it via an invocation of LaunchApp or LaunchApplication.

As a comment on someone else's answer, you can use the RegDBKeyExist function to read the registry and see if .NET is already installed.

For the registry keys, you might want to set this option:

REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;

This makes the registry search use the Wow64 registry redirection on 64-bit machines. That might be an issue.

Also, I think the default registry root is HKEY_CURRENT_USER. If you want to change it to, say, HKEY_LOCAL_MACHINE, you can do so by calling:

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

0
votes

Why don't you just check for this file:

%systemroot%\Microsoft.NET\Framework\v4.0.30319\System.Core.dll

It's guaranteed to be there if the framework v4 is installed.