Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28952 Discussions

"Intel Fortran Compiler runtime" registry key, or other way to determine installed version of runtim

Stacey_C_
Novice
3,846 Views

Our software is built with the Intel Fortran compiler in OneAPI.  We have included the Intel Fortran Compiler runtime in our InstallShield installers as prerequisites, so that our software will function.  InstallShield prerequisites provide configurable conditions upon which to install. If the condition is not met, then the user will not be notified that the prerequisite is needed.

Because the Intel Fortran Compiler runtime installers use different registry keys, the versions of our installer can never correctly check whether there is an earlier or later version of the runtime already installed.  Consequently, when installing old versions of our software, the user sees a message stating that an older version of the Intel Fortran runtime is needed, and then it tries to install, and fails.  The user gets a message that the installation has failed.

Some predictable way to check for the existing version of the Intel Fortran Compiler Runtime is needed!!

Does anyone have an idea where to check?  These are two different registry keys for the two different versions I have found to check.  I found these by manually searching through the Windows "uninstall" keys, until I found it.  Ideally, there would be ONE key somewhere to check for the version number, regardless of which version is installed.

Version 21.3.3372:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{65DE063A-904F-4A06-A4C0-82A2B1BAFB8A}

Version 23.0.25922:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{301329C5-31FC-4520-89AF-DB2A54217B26}

InstallShield can also check for the following conditions to determine whether to attempt to install a prerequisite.  I have been using "A registry entry has a specified version value."
InstallShield Prerequisite Condition Options.png

Is there a particular file that is always updated in each version of the runtime in the C:\Program Files (x86)\Common Files\Intel\Shared Libraries folder?  If so, I can check that file version using the "A file with a certain version exists" option.  However, it is possible (although rare) that a user might have Program Files on a different drive than "C," so I'm not sure if it would always work.

0 Kudos
1 Solution
Stacey_C_
Novice
3,633 Views

@Alina_S_Intel , thank you for your reply.  I got excited when you mentioned another key that could be checked to see what version of the runtime is installed.  Alas, I don't have that key.  I think it is only there when someone has the compiler installed.  Most of our users will not have the compiler installed.

It sounds like my only option is to have InstallShield ignore any failures to install the Intel Fortran Compiler Runtime.  By doing that, users won't get a message that installation of the runtime failed when they just have a more recent version already installed.  Failures for any other reason will just not be noticed, and it may take a while to troubleshoot, if there are problems with our application due to a missing Intel Fortran Runtime.

Stacey_C__1-1675882854420.png

 

View solution in original post

0 Kudos
15 Replies
mecej4
Honored Contributor III
3,798 Views

You may see if the FOR_IFCORE_VER() function will work for you. Note that this is an Intel-specific library function, and is part of the IFPORT library.

You may run into problems if a program is built with a reference to this function and one of your users has an old Ifort runtime that does not provide this function in its LIBIFPORT. I compiled the example code in the reference manual using OneAPI 2022. The resulting EXE worked correctly with Parallel Studio 2016, but not with Parallel Studio 2013 SP1.

Is there a reason why you do not ask your users to download and install the current RTL?

0 Kudos
Stacey_C_
Novice
3,773 Views

Mecej4, Thank you for replying. 

 

I'm not sure how to use that function/module. Is it something else the user will have to have on their computer first?  When InstallShield prerequisite conditions are checked, options are limited.  It's not able to run a program and receive output, but it can check the version of a windows file.  What is the file version that your program checks? Is it "C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64\libifportmd.dll"?  InstallShield can check the version of this file to determine whether to install, if that will work.

 

Stacey_C__1-1675783104536.png

 

We try to reduce the burden on our users and not require them to hunt down and install third party dependencies for our application.  Also, some of our users are not allowed to install software on their own computer, so we try to get everything done with a single install, saving the Admin's time.  If we build with OneAPI Fortran, that is our decision, and our users will need the runtime, so it is our responsibility to provide it. 

We also include the VC++ Redistributable, and MSMPI installers as prerequisite.  Both of those have no problems because they both have a predictable registry key where the version can be checked, and don't have a different registry key with every version.

0 Kudos
mecej4
Honored Contributor III
3,740 Views

Here is the scenario as I guessed it would be.

You provide your users with an EXE or DLL that they will use with some version of the Fortran redistributable DLLs installed on their PC, and you wish to check which version they have. In your EXE or DLL, you add a small subroutine that obtains the version that the user has, and take appropriate action if the version is too old for your needs, or too old to even return a version number.

Here is a a small program to illustrate.

program what_ifcore
    use ifport
    integer       :: res
    character*60  :: str

    res = for_ifcore_version( str )
    print ("(3A)"), "'", trim(str), "'"
! insert code to parse the string for version number,date, etc. 

end program what_ifcore

The string is of the form 'Intel Fortran RTL Core Library Version 2022.2.0 Nov 19 2022'. Your inserted code can extract the date and version number. If the version is acceptable, your EXE/DLL proceeds to do what it is doing now. If not, it outputs and error message, telling the users to contact you and explain why you need them to do so.

 

0 Kudos
Steve_Lionel
Honored Contributor III
3,772 Views

Attached you'll find code I wrote a while back for this purpose.

0 Kudos
Stacey_C_
Novice
3,769 Views

Thank you, Steve. Even if the code works, it looks like it will require Fortran to run it.  Also, InstallShield will not run a program and receive output in order to determine whether a prerequisite should be installed.  Our users may not have the Fortran runtime, and almost all of them will not have a Fortran compiler.

Perhaps rather than checking the version of "C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64\libifportmd.dll", I should check the version of "C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64\libifcoremd.dll" to determine if the user needs the latest runtime installed.  Does anyone here know if that will work?

0 Kudos
Steve_Lionel
Honored Contributor III
3,715 Views

The user does not need Fortran installed to run this - just make sure you build the program to link against static libraries.

Nowadays the redistributables may not be under Common Files if the user has installed the compiler, so you should not check for a specific location. The code I posted only cares if the DLLs are in PATH.

0 Kudos
andrew_4619
Honored Contributor III
3,754 Views

well of you know the "libifportmd.dll" version of your build version then you only need to know that the installed version is the same or higher, if not you need to do this  redist install. I would expect it is that simple. What Steve's program was doing was calling a windows API that looks at the dll file version, install shield can do that as you say.

 

 

 

0 Kudos
Stacey_C_
Novice
3,748 Views

Thank you, @andrew_4619 , yes that is correct.  However, I just checked with my team.  I have Intel Fortran Compiler Runtime version 23.0.25922, and they have 21.3.3372, so I asked them to check the file versions of the following files, and they are the same as mine. Ugh.

"C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64\libifcoremd.dll"
and
"C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64\libifportmd.dll"


0 Kudos
Steve_Lionel
Honored Contributor III
3,715 Views

The current compiler install does not update DLLs under Common Files - see my recent post.

0 Kudos
Stacey_C_
Novice
3,702 Views

Ugh.  More complication.

I see a lot of creative ideas about running code to determine the version, etc, but InstallShield prerequisites will not do that.  You define a condition for it to install or not install.  It can check certain things, like this, but you cannot make it run a program to receive a value.

https://docs.revenera.com/installshield23helplib/helplibrary/IDlgPrereqCondition.htm

Based on the available options at the link, what can I do?

My last option is to edit the Behavior tab, so that the setting for "If, after installing the prerequisite, the conditions still indicate it is required," I choose "Continue the setup."  This will mean that if the installation of the Intel Fortran Compiler Runtime fails for any reason, the user will not be notified.  I generally don't think this is a good idea, since it is usually preferable to know if it fails.

https://docs.revenera.com/installshield22helplib/helplibrary/UIRefPrereqEditor_Behavior.htm#ref-prereqeditor_2086859942_1025405

 

0 Kudos
Steve_Lionel
Honored Contributor III
3,683 Views

You can run a program to set a registry value, and then check it, yes?

0 Kudos
Stacey_C_
Novice
3,676 Views
No, unfortunately. That can’t be done until the main installer begins to run. The prerequisites are run before anything else, before it gets to our application installer where we have the ability to call customized functions.
0 Kudos
Alina_S_Intel
Employee
3,639 Views

Another options that is not mentioned:

  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Intel\Compilers\1AFortran\2023.34535\EM64T_NATIVE - note, that it might change from release to release
  • checking paths does not help in case of custom installation path; $ONEAPI_ROOT does not help you because you need to source setvars.bat first but you need to know oneAPI installation directory and if it is not default then you cannot run setvars.bat
  • the same for libraries. In case of custom installation we cannot check dll versions without knowing where they are


After an internal discussion, unfortunately, we cannot provide a unified and stable solution because there 2 options how users can have Fortran environment:



Redistributable Libraries are installed to different paths and using different installation methods. However, I would recommend you to look closely at Redistributable runtimes because it have much simpler installer that does not allow users to change install paths. They are installed into Program Files (x86)\Common Files\Intel\Shared Libraries and added to PATH.


More info:

https://www.intel.com/content/www/us/en/developer/articles/tool/redistributable-libraries-for-intel-c-and-fortran-2020-compilers-for-windows.html


0 Kudos
Stacey_C_
Novice
3,634 Views

@Alina_S_Intel , thank you for your reply.  I got excited when you mentioned another key that could be checked to see what version of the runtime is installed.  Alas, I don't have that key.  I think it is only there when someone has the compiler installed.  Most of our users will not have the compiler installed.

It sounds like my only option is to have InstallShield ignore any failures to install the Intel Fortran Compiler Runtime.  By doing that, users won't get a message that installation of the runtime failed when they just have a more recent version already installed.  Failures for any other reason will just not be noticed, and it may take a while to troubleshoot, if there are problems with our application due to a missing Intel Fortran Runtime.

Stacey_C__1-1675882854420.png

 

0 Kudos
Stacey_C_
Novice
3,512 Views

I do not like this solution, but it appears to be the only thing I can do to prevent users from getting a "failure" message from InstallShield when they might just have a later version of the Intel Fortran Runtime.  It may have failed for another reason, but we will never know. Since there is no consistent registry key for the Intel Fortran Runtime between versions, there is no predictable way for an InstallShield prerequisite to check for the existing version of the Intel Fortran Runtime.  So, we just have to ignore errors and hope for the best.

0 Kudos
Reply