how to detect C++ Redistributable and load if not.

336 views
Skip to first unread message

Adolph Dupre

unread,
Jan 25, 2022, 2:43:51 PM1/25/22
to innosetup


I’ve created an install program that does 90% of the install.  However, I don't know how to check for a redistributable and install if it isn't there (Needed to install MySQL drivers.)  I'm willing to pay for some one to guide me. Other parts of my install are clunky and I would like to have someone take a look and give me some pointers.

 

The rough specs are:

 

The Specs for Install program:

Install program is intended to be used exclusively within a company.  The installer will be used both inside the office and on portables in the field.

AN ftp site is available to store needed downloads. So the install program can be small enough to email.  An alternative would be placing the install program on the company share point site.

The install program should process the following steps:

  1. Check that the computer is Windows 10 or later.
    1. If not, inform user and stop install.
  2. Check whether the computer is 64 bit or 32 bit.
    1. This is needed for install of Visual studio redistributable and MySQL drivers.
  3. Check if Visual Redistributable is installed
    1. Must check for the specific bit(32/64) version.
    2. If not download and install.
  4. Check if a Specific version of MySQL is installed
    1. Must check for the specific bit(32/64) version.
    2. If not download and install.  A typical installation is OK.
  5. Check for local folders on local computer.  Create if they don’t exist.
    1. C:\Pennline\PPL

                                                               i.      Subfolders:

    1. \\Logs
    2. \\Previous
  1. Check if Microsoft access 16 or greater is installed:
    1. If installed, determine the Bit version
    2. If not installed. Download Runtime version and install
  2. Download some files into the newly created folder
    1. An access program. (Front end)

                                                               i.      There are 2 different ACCDE versions depending upon the Bitness of Microsoft Office/Access

                                                             ii.      Check for a file by name.  If it exists Inform the user and continue, but do not overwrite it

                                                           iii.      Download an icon. (used for the shortcut)

  1. Download a Shortcut and place on the user’s desktop.
    1. Overwrite if one exists
  2. Inform the user the install is complete
    1. If any of the steps are not successful, Inform user what step and instruct them to call their supervisor.

 

Andrew Truckle

unread,
Jan 29, 2022, 9:10:23 AM1/29/22
to innosetup
See:


I basically follow the principles there.


Sam Oxigen

unread,
Jan 31, 2022, 7:12:59 PM1/31/22
to innosetup
I have done almost exact type of "component" installations by checking windows major and build version, 32/64 bit version, necessity of c++ redistributables installation, processor architecture etc.  c++ redistributables need to be installed if windows 10 build version is equal or greater than 1607. On higher version this is part of the OS.
Some values are available from Inno (Pascal Delphi script-IDE: e.g. ProcessorArchitecture, IsWin64), other missing information is in registry (e.g. GetWindowsVersionEx(Version)RegQueryStringValue), etc.

Sam

Gavin Lambert

unread,
Jan 31, 2022, 7:26:55 PM1/31/22
to inno...@googlegroups.com
On 1/02/2022 13:12, Sam Oxigen wrote:
> I have done almost exact type of "component" installations by checking
> windows major and *build* version, 32/64 bit version, necessity of c++
> redistributables installation, processor architecture etc. c++
> redistributables need to be installed if windows 10 build version is
> equal or greater than 1607. On higher version this is part of the OS.
> Some values are available from Inno (Pascal Delphi script-IDE: e.g.
> /ProcessorArchitecture/, /IsWin64/), other missing information is in
> registry (e.g. /GetWindowsVersionEx(Version)/, /RegQueryStringValue/), etc.

It's always safest to assume that you do need to install the
redistributable.

While it's true that some versions of the redistributables are included
with Windows (or may have been installed by other applications), it
might be an older version than what you require, especially if you've
been keeping up to date with Visual Studio service packs and updates.

The redistributable installer itself will generally check the necessary
compatibility with Windows and if there is a previous version installed.

a...@programconsultants.com

unread,
Feb 1, 2022, 2:11:17 PM2/1/22
to inno...@googlegroups.com
So are you saying just go ahead and try to load the redistributable? What will it say if its already loaded?

Adolph
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/a581ed86-d91d-efbc-8733-7e1789814ec8%40mirality.co.nz.

a...@programconsultants.com

unread,
Feb 1, 2022, 2:12:25 PM2/1/22
to inno...@googlegroups.com

Thanks I’ll look at my code and compare.

Adolph

 

From: Sam Oxigen <ss111...@gmail.com>
Sent: Monday, January 31, 2022 7:13 PM
To: innosetup <inno...@googlegroups.com>
Subject: Re: how to detect C++ Redistributable and load if not.

 

I have done almost exact type of "component" installations by checking windows major and build version, 32/64 bit version, necessity of c++ redistributables installation, processor architecture etc.  c++ redistributables need to be installed if windows 10 build version is equal or greater than 1607. On higher version this is part of the OS.

--
You received this message because you are subscribed to a topic in the Google Groups "innosetup" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/innosetup/GJhB2JTxtE8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/cdb42ffb-3906-417f-b04e-8ef581635378n%40googlegroups.com.

Andrew Truckle

unread,
Feb 1, 2022, 3:35:56 PM2/1/22
to inno...@googlegroups.com
No!

He is saying check to see if you need to I stallit and then install it. Don’t assume the system installed it. 

The above is the safest and most effective solution. 

You received this message because you are subscribed to a topic in the Google Groups "innosetup" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/innosetup/GJhB2JTxtE8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/02d101d8179f%2479b8e930%246d2abb90%24%40programconsultants.com.

Gavin Lambert

unread,
Feb 1, 2022, 5:37:43 PM2/1/22
to inno...@googlegroups.com
On 2/02/2022 08:11, amd via innosetup wrote:
> So are you saying just go ahead and try to load the redistributable? What will it say if its already loaded?

For the most part, yes, you can just run it (with appropriate
silent-install parameters) and it should do nothing if already installed
(or a newer version is).

However it does produce a slightly better experience to first check the
registry path specified in the redistributable deployment documentation
and only run the redistributable installer if not installed or the
existing version is older.

But don't compare anything else (in particular, don't check Windows
versions) -- they're irrelevant and will lead to incorrect behaviour.
And don't try to guess at some other registry path to look at -- only
use the documented one.

You will also need to pay attention whether your application is compiled
as 32-bit or 64-bit, and in the latter case whether you have set the
installer to 64-bit mode or not.
Reply all
Reply to author
Forward
0 new messages