Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
systems:innosetup_installer [2011/09/16 10:09]
smayr
systems:innosetup_installer [2020/08/26 12:06] (current)
ajdavis
Line 109: Line 109:
 function isxdl_SetOption(Option, Value: PChar): Integer; function isxdl_SetOption(Option, Value: PChar): Integer;
 external 'isxdl_SetOption@files:isxdl.dll stdcall'; external 'isxdl_SetOption@files:isxdl.dll stdcall';
- 
  
 const const
Line 192: Line 191:
 </code> </code>
  
-== Detecting .NET 4.0 Framework & Installing It ==+== Detecting .NET 4.0 Framework & Installing It If Missing ==
  
 === Method 1 === === Method 1 ===
 Source: http://www.vbforums.com/showthread.php?t=620221 Source: http://www.vbforums.com/showthread.php?t=620221
  
-innosetup checking for 4.0 framework and installing if missing +<code inno>
-Found a script online and tweaked it a bit. Figure others would like it to +
 [CustomMessages] [CustomMessages]
 dotnetmissing=This application requires Microsoft Framework 4.0 which is not yet installed on this computer. Would you like to download it now? dotnetmissing=This application requires Microsoft Framework 4.0 which is not yet installed on this computer. Would you like to download it now?
  
 +. . .
  
 +[Code]
 function InitializeSetup(): Boolean; function InitializeSetup(): Boolean;
 var var
-ErrorCode: Integer; +  ErrorCode: Integer; 
-netFrameWorkInstalled : Boolean; +  netFrameWorkInstalled : Boolean; 
-isInstalled: Cardinal;+  isInstalled: Cardinal;
 begin begin
-result := true;+  result := true;
  
-// Check for the .Net 4.0 framework +  // Check for the .Net 4.0 framework 
-isInstalled := 0; +  isInstalled := 0; 
-netFrameworkInstalled := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\client', 'Install', isInstalled); +  netFrameworkInstalled := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\client', 'Install', isInstalled); 
-if ((netFrameworkInstalled) and (isInstalled <> 1)) then netFrameworkInstalled := false;+  if ((netFrameworkInstalled) and (isInstalled <> 1)) then begin 
 +    netFrameworkInstalled := false
 +  end;
  
- +  if netFrameworkInstalled = false then begin 
- +    if (MsgBox(ExpandConstant('{cm:dotnetmissing}'), mbConfirmation, MB_YESNO) = idYes) then 
- +    begin 
-if netFrameworkInstalled = false then +      ShellExec('open', 
-begin +         'http://www.microsoft.com/downloads/details.aspx?familyid=9CFB2D51-5FF4-4491-B0E5-B386F32C0992&displaylang=en', 
-if (MsgBox(ExpandConstant('{cm:dotnetmissing}'), +         '','',SW_SHOWNORMAL,ewNoWait,ErrorCode); 
-mbConfirmation, MB_YESNO) = idYes) then +    end; 
-begin +    result := false; 
-ShellExec('open', +  end;
-'http://www.microsoft.com/downloads/details.aspx?familyid=9CFB2D51-5FF4-4491-B0E5-B386F32C0992&displaylang=en', +
-'','',SW_SHOWNORMAL,ewNoWait,ErrorCode); +
-end; +
-result := false; +
-end;+
  
 end; end;
 +</code>
  
 === Method 2 === === Method 2 ===
 Source: http://www.vbforums.com/showthread.php?t=620221 Source: http://www.vbforums.com/showthread.php?t=620221
  
-This code checks, downloads and installs it if needed. Make sure you have the isxdl.dll also deployed. If you don't know how it works Google: "isxdl.dll Innosetup".+This code checks, downloads and installs it if needed. Verify the file ''isxdl.dll'' (InnoSetup third-party tool) is also deployed. 
  
 +<code inno>
 [CustomMessages] [CustomMessages]
 dotnetfx40_title=.NET Framework 4.0 dotnetfx40_title=.NET Framework 4.0
 +dotnetfx40_size=48.1 MB
  
-en.dotnetfx40_size=48.1 MB+. . .
  
-[code]+[Code]
 const const
-dotnetfx40_url = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe';+  dotnetfx40_url = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe';
  
 procedure dotnetfx40(); procedure dotnetfx40();
 var var
-version: cardinal;+  version: cardinal;
 begin begin
-RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Install', version); +  RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Install', version); 
-if version <> 1 then +  if version <> 1 then begin 
-AddProduct('dotNetFx40_Full_x86_x64.exe', +    AddProduct('dotNetFx40_Full_x86_x64.exe', 
-'/q /norestart', +      '/q /norestart', 
-CustomMessage('dotnetfx40_title'), +      CustomMessage('dotnetfx40_title'), 
-CustomMessage('dotnetfx40_size'), +      CustomMessage('dotnetfx40_size'), 
-dotnetfx40_url);+      dotnetfx40_url)
 +  end;
 end; end;
 +</code>
  
 == Installer Tips == == Installer Tips ==
 === Restart Computer === === Restart Computer ===
-When an installer, after its installation, asks to restart the computer, you can avoid doing so by deleting (or renaming) the following Windows registry value:+When an installer, after its installation, asks to restart the computer, you can avoid doing so removing the pertinent pending operations from the following Windows registry value:
 <code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations</code> <code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations</code>
  
Line 279: Line 280:
 ==== How To Do A Clean Boot Using the System Configuration Utility ==== ==== How To Do A Clean Boot Using the System Configuration Utility ====
  
-1. Click "Start", click "Run", type "msconfig" (without the quotation marks), and then click "OK"+ # Click "Start", click "Run", type "msconfig" (without the quotation marks), and then click "OK"
-2. In "System Configuration Utility", click the "Services" tab, and then click to select the "Hide all Microsoft Services" check box. + In "System Configuration Utility", click the "Services" tab, and then click to select the "Hide all Microsoft Services" check box. 
-3. Click "Disable All" + Click "Disable All" 
-4. Click "Startup" tab. + Click "Startup" tab. 
-5. Click "Disable All" + Click "Disable All" 
-6. Click "Apply" then "Close" + Click "Apply" then "Close" 
-7. Restart computer + Restart computer 
-8. Insert the <product> CD and install the program.+ Insert the <product> CD and install the program.
  
 When the installation is complete you must restore your computer from a clean boot. When the installation is complete you must restore your computer from a clean boot.
  
-1. Click "Start", click "Run", type "msconfig" (without the quotation marks), and then click "OK". + # Click "Start", click "Run", type "msconfig" (without the quotation marks), and then click "OK". Note: you can choose to do the following steps or just click "Normal Startup" on the General tab. 
-Note: you can choose to do the following steps or just click "Normal Startup" on the General tab. + In "System Configuration Utility", click the "Services" tab, and then click "Enable All" 
-2. In "System Configuration Utility", click the "Services" tab, and then click "Enable All" + Click "Startup" tab. 
-3. Click "Startup" tab. + Click "Enable" All 
-4. Click "Enable" All + Click "Apply" then Close 
-5. Click "Apply" then Close + Restart computer
-6. Restart computer+
  
 ------------------------------------------------------------------ ------------------------------------------------------------------
Line 304: Line 304:
 > With a customer we run in to the following problem. > With a customer we run in to the following problem.
 > >
-> He starts the setup and a random point it gets killed (not an normal +> He starts the setup and at a random point it gets killed (not an normal 
 > stop).... > stop)....
 > >
-Weh I use the /LOG option the log also just stops at a point en no  +When I use the /LOG optionthe log also just stops at a point and no  
-> closing/stop info of inno setup is loggen. Also the temporary created  +> closing/stop info of inno setup is logged. Also the temporary created  
-> folders are still there. This suggest that (probebly some other process - +> folders are still there. This suggest that (probably some other process - 
 > aka virusscanner) is killing the installer process... > aka virusscanner) is killing the installer process...
  
 +== Plugin: File Downloader IDP ==
 +
 +  * Download: [[https://mitrichsoftware.wordpress.com/inno-setup-tools/inno-download-plugin/]]
 +  * Uses: FTP, HTTP and HTTPS protocols
 +
 +Example:
 +<code inno>
 +#include <idp.iss>
 +
 +[Files]
 +Source: "{tmp}\file1.xyz"; DestDir: "{app}"; Flags: external; ExternalSize: 1048576
 +Source: "{tmp}\file2.xyz"; DestDir: "{app}"; Flags: external; ExternalSize: 1048576
 +Source: "{tmp}\file3.xyz"; DestDir: "{app}"; Flags: external; ExternalSize: 1048576
 +
 +[Icons]
 +Name: "{group}\{cm:UninstallProgram,My Program}"; Filename: "{uninstallexe}"
 +
 +[Code]
 +procedure InitializeWizard();
 +begin
 +    idpAddFileSize('http://127.0.0.1/file1.xyz', ExpandConstant('{tmp}\file1.xyz'), 1048576);
 +    idpAddFileSize('http://127.0.0.1/file2.xyz', ExpandConstant('{tmp}\file2.xyz'), 1048576);
 +    idpAddFileSize('http://127.0.0.1/file3.xyz', ExpandConstant('{tmp}\file3.xyz'), 1048576);
 +
 +    idpDownloadAfter(wpReady);
 +end.
 +</code>