Home

MarcWelcome at my virtual home in the cyberspace.

This is my personal website where I publish lot of different things. It started with Software I have written in my free time - NOT at my job. When time has past some articles about programing and components found their way to this site. My personal stuff like articles, blogs, gallery, hobbies is moved to marcduerst.com.

Enjoy your stay here!
Marc

 

 

Software

SoftwareWithin this section you will find PC-Software that I've written in my free over the last couple of years. Some of them are freeware others are shareware.

Go: Mail Inspector , iCarbon , Liftoff , Icon Collection , iHelp or Other Tools

InnoSetup: Check for .Net 3.5 PDF Print E-mail
Written by Marc   
02.06.2008

After some time away from InnoSetup I'm back on that tool again to build some fairly complex Installers. Most of them need to check if .Net Version 3.5 is installed on the workstation the Software is installed. If .Net 3.5 is not yet installed the Installer should show a message box to the user right at the beginning and asking if he wants to download .Net 3.5 right now. If the user clicks "Yes" the Microsoft Download-Page will be shown otherwise the Installed will be canceled.

To do this one need a little InnoScript (Pascal) and a custom message so it can be translated easily. Add the following code to your InnoSetup script to do this:

[CustomMessages]
dotnetmissing=This application needs Microsoft .Net Version 3.5. Do you like to download and install it now?

 
[CustomMessages]
dotnetmissing=This application needs Microsoft .Net 3.5 which is not yet installed. Do you like to download it now?
[Code]
function InitializeSetup(): Boolean;
var
    ErrorCode: Integer;
    netFrameWorkInstalled : Boolean;
    isInstalled: Cardinal;
begin
  result := true;
 
    // Check for the .Net 3.5 framework
  isInstalled := 0;
  netFrameworkInstalled := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5', 'Install', isInstalled);
  if ((netFrameworkInstalled)  and (isInstalled <> 1)) then netFrameworkInstalled := false;
 
  if netFrameworkInstalled = false then
  begin
    if (MsgBox(ExpandConstant('{cm:dotnetmissing}'),
        mbConfirmation, MB_YESNO) = idYes) then
    begin
      ShellExec('open',
      'http://www.microsoft.com/downloads/details.aspx?FamilyID=333325fd-ae52-4e35-b531-508d977d32a6&DisplayLang=en',
      '','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
    end;
    result := false;
  end;
 
end;
 

More advanced will be the integration of download and install it right within the Installer itself. This topic will be covered later on. Contact me, if you need this.

 
Next >

Marcs Blog

rss.pngYou can get my blog by RSS now!
Ihr könnt mein Blog auch per RSS-Newsfeeds abfragen.
Joomla Template design by RocketTheme