|
agreed this article rocks, but as jonny asks, possible to extend it to support .NET4 and .NET4ClientProfile ?
Looks like it is modulised enough, but don't fully understand the coding behind InnoSetup scripts.
|
|
|
|
|
Hey,
Here we go, these two should work
.NET Framework 4 (Full)
Put the below code into a file named "dotnetfx40.iss"
[CustomMessages]
dotnetfx40_title=.NET Framework 4.0
en.dotnetfx40_size=48.1 MB
de.dotnetfx40_size=48,1 MB
[Code]
const
dotnetfx40_url = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe';
procedure dotnetfx40();
var
version: cardinal;
begin
RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Install', version);
if version <> 1 then
AddProduct('dotNetFx40_Full_x86_x64.exe',
'/q /norestart',
CustomMessage('dotnetfx40_title'),
CustomMessage('dotnetfx40_size'),
dotnetfx40_url);
end;
.NET Framework 4 (Client)
Put the below code into a file named "dotnetfx40client.iss"
[CustomMessages]
dotnetfx40_title=.NET Framework 4.0 Client Profile
en.dotnetfx40_size=48.1 MB
de.dotnetfx40_size=48,1 MB
[Code]
const
dotnetfx40_url = 'http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe';
procedure dotnetfx40client();
var
version: cardinal;
begin
RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Client', 'Install', version);
if version <> 1 then
AddProduct('dotNetFx40_Client_x86_x64',
'/q /norestart',
CustomMessage('dotnetfx40_title'),
CustomMessage('dotnetfx40_size'),
dotnetfx40_url);
end;
Don't forget to add the lines #include "dotnetfx40.iss" or #include "dotnetfx40client.iss" at the top of your setup file script.
Anthony
|
|
|
|
|
Hello,
Firstly, thank you for your scripts. They are a life-saver and I love how I can control every aspect of the installation.
I am using your script to install .NET 3.5 Client Profile + my application. The download / install ratio is about 45%. And I keep improving it , it started on about 30%.
I am logging all user actions into a variable and at the end of install process I open a webpage with the contents of the variable in the querystring. That allows me to know exactly where users have problems.
This lead me to a finding that biggest drop out is on failed Windows Installer 3.1 installations. Only about 10% of users that don't have MSI3.1 are able to install it successfully (I do checks for Windows XP before to ensure MSI3.1 can be installed - so 90% of MSI3.1 install attempts fails on systems where it should succeed).
I cannot figure out why is it so. When I simulate the installation on Windows XP with no MSI 3.1 the installation process is quite smooth and success.
I don't know how to debug failure of Windows Installer , the only thing I know is that Result Code of MSI 3.1 installation is 1603 - FATAL ERROR.
My install script checks following:
initwinversion();<br />
<br />
RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v3.5', 'Install', version);<br />
if version <> 1 then begin<br />
if not minwinspversion(5, 0, 3) then begin<br />
MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('win2000sp3_title')]), mbError, MB_OK);<br />
exit;<br />
end;<br />
if not minwinspversion(5, 1, 2) then begin<br />
MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('winxpsp2_title')]), mbError, MB_OK);<br />
exit;<br />
end;<br />
msi31('3.1');<br />
ie6('5.0.2919');<br />
AddProduct('DotNetFx35ClientSetup.exe','/lang:enu /qb /norestart',CustomMessage('dotnetfx35_title'),CustomMessage('dotnetfx35_size'), dotnetfx35_url);<br />
end
Any ideas how to figure out what is wrong?
P.S (just a side not, all those % ratios have been measured on 1000's of installations and I have double checked them to ensure they are correct)
|
|
|
|
|
First, sorry for my bad english
Second, thanks to stfx for that great tool!
I used this tool to write a setup for a C# project, that needs MSI 3.1, .NET-Framework 3.5 and SQL Server Compact 3.5.
But SQL Server Compact 3.5 is only available as .msi package! For this reason I changed the lines in "products.iss":
...
//if Exec(products[i].File, products[i].Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then begin
if ShellExec('', products[i].File, products[i].Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then begin // %%SH: ShellExec() installiert auch MSI-Pakete
...
With this change it is also possible to install .msi files!
greetings, Sascha
|
|
|
|
|
You may choose not to fix this, but these scripts seem broken on 5.3.8(a) Inno build. The error is "products.iss Line 114, Column 10 Invalid prototype for PrepareToInstall". Unless, maybe I'm doing something wrong (I just downloaded everything and tried compiling setup.iss without making any change ). I'd love to use these scripts, but from looking at the Inno changelog, it's important to use the latest version of that as well, as it has numerous fixes for Windows 7.
|
|
|
|
|
I just changed line 114 in products.iss to read: function PrepareToInstall(var NeedsRestart: Boolean): String;
Let me know if this is the wrong fix, I'm new to all this.
|
|
|
|
|
|
Same error too. I´m using Inno Setup 5.3.10 and IS Tool 5.3.0.1
Any solution ??? Plz i rly need this script.
|
|
|
|
|
This function declaration has changed in newer inno setup versions. It's declaration is now:
function PrepareToInstall(var NeedsRestart: Boolean): String;
See the inno help file for more information.
|
|
|
|
|
I confirm that this fixes the error.
|
|
|
|
|
Hi!
This is the best and easiest to use solution I found on the net to install dependencies...
However, at least for completeness, it would be nice if other often used runimes would be added too.
(despite it would be easy to implement ourselves using the existing examples, except for the hassle to find the newest version at MS)
Of course in case of MSVC I might compile static to avoid having to run the MSVC++ installer, except if you include a third party binary dll or executable which requires these (not recommended by MS).
To check the existence of the runtime some recommend just to try to load the main DLL of the runtime in a try ... catch block.
With MSVC 6 one could still include the needed DLLs (and there is an example on the inno setup homepage),
but with managed code etc. in newer versions the only option seems to be to run the msvc_redist installer to install the runtime correctly.
Regards, Rune B.
P.S. how stable are the cryptic links at MS? Will they continue to exist?
Would it be an option to skip downloading if the download already lies next to the installer of the app?
If giving the app to someone on a share or media one could put the required runtimes right next to it.
(like the open source impementation "The Ur-Quan Masters" installer of "Star Control II" does for it's addons,
this would give the user the advantage of the silent install even if not havining the app's installer do the download itself.)
|
|
|
|
|
Hi,
I set the DependenciesDir to "Resources".
the installer is located here:
D:\install\setup.exe
I was expecting that the installer will look in D:\install\Resources\ for needed dependencies.
I don't want them to be downloaded.
For example I am trying to install .NET 3.5 and .NET 3.5 SP1.
According to dotnetfx35.iss and dotnetfx35sp1.iss the installer should look for dotnetfx35.exe and dotnetfx35sp1.exe in the DependenciesDir.
I don't know what is wrong but it keeps trying to download these files.
Any advice?
Other than that, I really like your work! Makes things easier a lot. Thanks for that!
Best
Ronny
|
|
|
|
|
Hi!
Just now.I did it.
(but try dotnetfx20.exe)
products.iss
<pre>#include "isxdl\isxdl.iss"
[CustomMessages]
;DependenciesDir=MyProgramDependencies
DependenciesDir=.\
</pre>
It change dafault("MyProgramDependencies") to ".\" ,same folder ok.
So, I think you change
DependenciesDir=Resources
and set
d:\install\Resources\dotnetfx35.exe and dotnetfx35sp1.exe
Regards
Yamada (from Japan)
|
|
|
|
|
Hi,
I saw code to create setup for 32 bit and 64 bit machine.
All things are same except source file name.
My question is :
If I have same exe to run on 32 and 64 bit machine and I want to create one setup, Shell i have to build in "ArchitecturesInstallIn64BitMode=x64 ia64".
|
|
|
|
|
Hi, does anybody have any suggestion for downloading Windows Installer 4.5 ?
Thanks
Petr
|
|
|
|
|
I have downloaded Windows2000-KB835732-x86-CHS.exe. This commandline parameters for this app are now using:
/quit
/passive
/norestart
etc.
So, I changed those in kb835732.iss from
'/q:a /c:"install /q"'
to
'/passive /norestart'.
However, the function of
Exec(products[i].File, products[i].Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode)
in products.iss always got failed. That ResultCode didn't equate to 0.
The installation for dotnetfx20 is OK.
Thanks for any help.
|
|
|
|
|
Hi!
I had same case.Its my way.....
So, I changed kb835732.iss
'/q:a /c:"install /q"'
to
''
I found message and understood.
Windows2000-KB835732-x86-ENU.EXE can't use(Windows 2000 Japanese Edition) .Have to use Windows2000-KB835732-x86-JPN.EXE
If korean use, same problem...(May be use -KOR.EXE)
Then.....
I use dotnetfx20(not SP1).
I'm ok, because windows update automatically change SP1.
Regareds
Yamada
|
|
|
|
|
i downloaded the zip folder and i changed the files part with this part according to my need:
[Files]
Source: "C:\Users\Gautam\Documents\Visual Studio 2005\Projects\Final_Etech(Submit)\Final_Etech\bin\Debug\Final_Etech.exe"; DestDir: "{app}";
Source: "E:\Softy\DOT_NET\.NETFramework_2.0_Installer\dotnetfx.exe"; DestDir: "{app}";
Source: "C:\Users\Gautam\Documents\Visual Studio 2005\Projects\Final_Etech(Submit)\Final_Etech\bin\Debug\Etech.mdb"; DestDir: "{app}";
Source: "C:\Users\Gautam\Documents\Visual Studio 2005\Projects\Final_Etech(Submit)\Final_Etech\bin\Debug\AdminLogin.mdb"; DestDir: "{app}";
Source: "d:\Readme.txt"; DestDir: "{app}"; Flags: isreadme
also in some places i have to change the name of the .exe file........
but doing this is causing me problems with the .mdb file........
what should i do to the ,mdb file then?
please help
thank you
|
|
|
|
|
Hi,
Great code guy
i've added French support, Deutch x64 support for one patch.
i've changed some code in KB835732 to support English/Deutch/French and its arguments which wasn't correct
how can i submit it to you ?
----------------------------------------------
Under win2k Pro, it seems that multiple patch works bad (SP4 + patches without .NET):
- All is downloaded without any problem
- KB835732 has been installed but we have an error message at the end (so 3 patches are tagged as not deployed). But this patch appear in Add/removeprograms
So : I've checked in %WINDIR% : \$NtUninstallKB835732$ is present so patch is installed and ok.
- I launch setup again. Only .NET 2.0SP1 & language pack appear.
- Install failed again.
- I launch setup again. Only Language pack appear
- install OK, program OK.
I'm using 2.0 SP1 because 2.0SP2 is not compatible with Win2K.
Any idea ?
|
|
|
|
|
i've checked with WinXP Pro SP3 Fr. No problem, all is ok.
i've checked with Vista Pro SP2 Fr. Small problem, .NET2.0 don't exist so I think I must change setup to download .NET3.5 for Vista & 7
Here's the code :
if minwinversion(6, 0) then begin
dotnetfx35sp1();
dotnetfx35sp1lp();
end else begin
if minwinversion(5, 1) then begin
dotnetfx20sp2();
dotnetfx20sp2lp();
end else begin
if minwinversion(5, 0) and minwinspversion(5, 0, 4) then begin
kb835732();
dotnetfx20sp1();
dotnetfx20sp1lp();
end else begin
dotnetfx20();
dotnetfx20lp();
end;
end;
end;
But same problem as Win 2K Pro : .NET 3.5 failed but is installed. 2nd install will deploy Language pack.
modified on Friday, January 15, 2010 6:57 AM
|
|
|
|
|
Dear stfx,
your article really rules!!!
I found a problem in isxdl.dll on win98:
-version 5.3.0 fails to be loaded
-version 5.1.5 is loaded successfully
So, when you write the requirements, i.e.
"Applications used for the script are:
* Inno Setup - setup engine (version 5.3.4)
* ISTool - extends Inno Setup but I just needed the isxdl.dll downloader (version 5.3.0)"
I think you should decide if support w98 or use ISTool 5.3.0
... this, of course, is valid if you have my same problem too ...
I tried to get in touch with the ISTool developer w/o success ...
Regards,
Ace
|
|
|
|
|
Thank you good information.I save time.
Additonally....
isxdl.dll
Version 5.1.5
Windows98SE/2000 download speed and file xx of xx did't display.
(I think asian font problem)
Windows XP japanese / XP english edition is ok.
Version 5.3.0
Windows2000 can display speed and file xx% of xx%.
(but win98 didn't work)
Thank you.
Yamada
|
|
|
|
|
I added a language pack chinese.ini to isxdl\chinese.ini, and I tried use Unicode, local chinese encoding, both are NOT working. the download page cannot display the chinese at all. I have no idea.
I'm on an English XP, and I installed "Asian Language Files" via "Control Panel".
My InnoSetup is unicode version.
I don't know why. Can you tell me how you made your language file?
Thanks. Arigatou gozaimasu.
Peter
|
|
|
|
|
You save me lots of hours. Dealing with MS Setup and program data on W7 I recall Inno setup I used years ago...
Finished installation after 30 minutes even with MySQL and .NET35 prerequisity...
Gold medal for you...
|
|
|
|
|
Hi guys,
I've noted that the version comparison in some cases does not work correctly, for example when installing on an pc the msi 3.1 cannot install because the version installed on it is greatter then the check but the check is returning that it's not.
Looking at the code, the comparison is just between strings ... so I think its better to improve this comparison to not fail ...
procedure msi31(MinVersion: string);
begin
// Check for required Windows Installer 3.0 on Windows 2000 or higher
if minwinversion(5, 0) and (fileversion(ExpandConstant('{sys}{\}msi.dll')) < MinVersion) then
AddProduct('msi31.exe',
'/qb /norestart',
CustomMessage('msi31_title'),
CustomMessage('msi31_size'),
msi31_url);
end;
I've improved to this one that gets the msi dll location from registry, but the comparison stills the same ... any tips on comparing versions ?
procedure msi31(MinVersion: string);
var
sMSIDll: string;
begin
// Check for required Windows Installer 3.0 on Windows 2000 or higher
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Microsoft\Windows\CurrentVersion\Installer',
'InstallerLocation', sMSIDll) then
sMSIDll := sMSIDll + 'msi.dll' else
sMSIDll := ExpandConstant('{sys}{\}')+'msi.dll';
if minwinversion(5, 0) and (fileversion(sMSIDll) < MinVersion) then
AddProduct('msi31.exe',
'/quiet /norestart',
CustomMessage('msi31_title'),
CustomMessage('msi31_size'),
msi31_url);
end;
|
|
|
|
|