Results 1 to 9 of 9

Thread: [RESOLVED] Installing C++ 2008 runtime files with Inno

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Resolved [RESOLVED] Installing C++ 2008 runtime files with Inno

    Hi, one of the files included in my installation package is the OpenSSL commandline tool, but it requires the C++ 2008 runtime files and those are not always installed.

    I'd like to add them to my installation package, but I have no idea how to do that. The other problem is that there are two versions of the C++ 2008 runtime files (x86 and x64) and obviously the correct one needs to be installed based on the OS.

    x86: http://www.microsoft.com/downloads/d...displaylang=en

    x64: http://www.microsoft.com/downloads/d...displaylang=en

    Does anybody know what Inno Setup script to use in order to install those runtime files?


    ::Edit::

    Apparently OpenSSL 32Bit also works on a 64Bit OS, so I just need to know how to install the C++ Runtime files for 32Bit.
    Last edited by Chris001; Jan 6th, 2010 at 01:28 PM.

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Installing C++ 2008 runtime files with Inno

    At first I didn't find a solution, because I was looking for a way to install the runtime files myself, so I could do a silent installation, but it can easily be done with the two lines of code below.

    Code:
    [Files]
    Source: "vcredist_x86.exe"; DestDir: "{tmp}"
    
    [Run]
    Filename: {tmp}\vcredist_x86.exe; Parameters: /q
    The problem now is that it takes much, much longer to install the C++ runtime files.

    If I install the runtime files manually by double-clicking on vcredist_x86.exe, it takes less than 5 seconds to install the files. With vcredist_x86.exe added to the Inno Setup installer, the screen below shows for about 40 seconds, even if the C++ runtime files are already installed.

    Is there a solution for this?


  3. #3
    Addicted Member
    Join Date
    Nov 2006
    Posts
    204

    Re: Installing C++ 2008 runtime files with Inno

    Hi Chris,
    did you solve this problem?

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Installing C++ 2008 runtime files with Inno

    No, I haven't solved this problem. I just put a message on my website that the installation might take a while.

  5. #5
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Installing C++ 2008 runtime files with Inno

    You can also ask it on the newsgroup of innosetup:

    http://news.jrsoftware.org/read/

    To bad they don't have a normal forum for Inno.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Installing C++ 2008 runtime files with Inno


  7. #7
    Addicted Member
    Join Date
    Nov 2006
    Posts
    204

    Re: Installing C++ 2008 runtime files with Inno

    Hi Chris,

    try this:
    Code:
    Filename: {src}\Redistributables\vcredist_x86.exe; Parameters: "/q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """;
    It works much faster for me.
    Alex.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Installing C++ 2008 runtime files with Inno

    Thank you, alex30. That works much faster indeed

  9. #9
    New Member
    Join Date
    Nov 2015
    Posts
    1

    Re: [RESOLVED] Installing C++ 2008 runtime files with Inno

    [CODE]#define VCmsg "Installing Microsoft Visual C++ Redistributable...."

    [Run]
    Filename: "vc_redist.x86.exe"; StatusMsg: "{#VCmsg}"; Check: not IsWin64 and not VCinstalled
    Filename: "vc_redist.x64.exe"; StatusMsg: "{#VCmsg}"; Check: IsWin64 and not VCinstalled

    Code:
    function VCinstalled: Boolean;
     // By Michael Weiner <mailto:[email protected]>
     // Function for Inno Setup Compiler
     // 13 November 2015
     // Returns True if Microsoft Visual C++ Redistributable is installed, otherwise False.
     // The programmer may set the year of redistributable to find; see below.
     var
      names: TArrayOfString;
      i: Integer;
      dName, key, year: String;
     begin
      // Year of redistributable to find; leave null to find installation for any year.
      year := '';
      Result := False;
      key := 'Software\Microsoft\Windows\CurrentVersion\Uninstall';
      // Get an array of all of the uninstall subkey names.
      if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, key, names) then
       // Uninstall subkey names were found.
       begin
        i := 0
        while ((i < GetArrayLength(names)) and (Result = False)) do
         // The loop will end as soon as one instance of a Visual C++ redistributable is found.
         begin
          // For each uninstall subkey, look for a DisplayName value.
          // If not found, then the subkey name will be used instead.
          if not RegQueryStringValue(HKEY_LOCAL_MACHINE, key + '\' + names[i], 'DisplayName', dName) then
           dName := names[i];
          // See if the value contains both of the strings below.
          Result := (Pos(Trim('Visual C++ ' + year),dName) * Pos('Redistributable',dName) <> 0)
          i := i + 1;
         end;
       end;
     end;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width