|
|
It's a perfect project Thanks
|
|
|
|
|
Hi.
I ship 2 versions of my program a x86 and x64 bit of my application.
I have noticed when the user tries to install my 32 bit version on a 64 bit OS the scripts will detect it's a 64 bit system and install the 64 bit resources. This causes my 32 bit application to crash with System.IO (File Missing) Error.
To prevent this.. I have to force the x86 resources for my 32 bit app on the 64bit OS
In my Inno Setup File above [Setup] add this line.
;comment out this next line if your app is 64 bit or Any CPU
#define force_x86
Next find this block of code.
#ifdef use_vc2013
vcredist2013();
#endif
and replace it with this one.
#ifdef use_vc2013
#ifdef force_x86
vcredist2013(true); #else
vcredist2013(false); #endif
#endif
Here is my modified vcredist2013.iss
[CustomMessages]
vcredist2013_title=Visual C++ 2013 Redistributable
vcredist2013_title_x64=Visual C++ 2013 64-Bit Redistributable
en.vcredist2013_size=6.2 MB
de.vcredist2013_size=6,2 MB
en.vcredist2013_size_x64=6.9 MB
de.vcredist2013_size_x64=6,9 MB
[Code]
const
vcredist2013_url = 'http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe';
vcredist2013_url_x64 = 'http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe';
vcredist2013_productcode = '{13A4EE12-23EA-3371-91EE-EFB36DDFFF3E}';
vcredist2013_productcode_x64 = '{A749D8E6-B613-3BE3-8F5F-045C84EBA29B}';
procedure vcredist2013(Force_x86:Boolean);
begin
if (not IsIA64()) then begin
if (IsX64()) then begin
if (Force_x86 = true) then begin
if (not msiproduct(GetString(vcredist2013_productcode, vcredist2013_productcode, ''))) then begin
AddProduct('vcredist2013' + '.exe', '/passive /norestart',
CustomMessage('vcredist2013_title'),
CustomMessage('vcredist2013_size'),
GetString(vcredist2013_url, vcredist2013_url, ''), false, false);
end;
end else if (Force_x86 = false) then begin
if (not msiproduct(GetString(vcredist2013_productcode, vcredist2013_productcode_x64, ''))) then begin
AddProduct('vcredist2013' + GetArchitectureString() + '.exe', '/passive /norestart',
CustomMessage('vcredist2013_title' + GetArchitectureString()),
CustomMessage('vcredist2013_size' + GetArchitectureString()),
GetString(vcredist2013_url, vcredist2013_url_x64, ''), false, false);
end;
end;
end else if (IsX86()) then begin
if (not msiproduct(GetString(vcredist2013_productcode, vcredist2013_productcode_x64, ''))) then begin
AddProduct('vcredist2013' + GetArchitectureString() + '.exe', '/passive /norestart',
CustomMessage('vcredist2013_title' + GetArchitectureString()),
CustomMessage('vcredist2013_size' + GetArchitectureString()),
GetString(vcredist2013_url, vcredist2013_url_x64, ''),false, false);
end;
end;
end;
end;
You can modify the same thing with 2005,2008,2010,2012,2015
This fixes the following issues.
when the force_x86 flag is enabled.
======================================
1. Will install x86 resources instead of the x64 version
2. Will install the x86 version even if the x64 version is already installed.
when the force_x86 flag is not enabled (commented out)
1. It will auto detect as normal
Having experience with .NET 4.0 you can install the 64 bit resource and run 32 or 64 bit applications on a 64bit OS, but it seems that the C++ resources are different, you have to have the 32 bit or 64 bit version in which you want to run.. I have noticed this true on windows 8.1 and windows 10
Thanks,
David Eaton
modified 15-Aug-15 7:54am.
|
|
|
|
|
First let me say we love, love, love this tool - we've used it in our apps for years.
But it seems like it might have an issue on Windows 10. It insists on downloading and installing NET 4.5.2 every time even though this should come installed with Win 10 already.
Can anyone else confirm this issue, or know of a workaround or patch to solve it?
Thanks!
|
|
|
|
|
Hi,
I had the same problem and I modified the dotnetfxversion.iss file like that and working for me.
[Code]
type
NetFXType = (NetFx10, NetFx11, NetFx20, NetFx30, NetFx35, NetFx40Client, NetFx40Full, NetFx45);
const
netfx11plus_reg = 'Software\Microsoft\NET Framework Setup\NDP\';
function netfxinstalled(version: NetFXType; lcid: string): boolean;
var
regVersion: cardinal;
regVersionString: string;
begin
if (lcid <> '') then
lcid := '\' + lcid;
if (version = NetFx10) then begin
RegQueryStringValue(HKLM, 'Software\Microsoft\.NETFramework\Policy\v1.0\3705', 'Install', regVersionString);
Result := regVersionString <> '';
end else begin
case version of
NetFx11:
RegQueryDWordValue(HKLM, netfx11plus_reg + 'v1.1.4322' + lcid, 'Install', regVersion);
NetFx20:
RegQueryDWordValue(HKLM, netfx11plus_reg + 'v2.0.50727' + lcid, 'Install', regVersion);
NetFx30:
RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.0\Setup' + lcid, 'InstallSuccess', regVersion);
NetFx35:
RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.5' + lcid, 'Install', regVersion);
NetFx40Client:
RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Client' + lcid, 'Install', regVersion);
NetFx40Full:
RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Install', regVersion);
NetFx45:
begin
RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Release', regVersion);
// >= 4.5.0 and <= 4.6.0
Result := (regVersion >= 378389) and (regVersion <= 393295);
Exit;
end;
end;
Result := (regVersion <> 0);
end;
end;
function netfxspversion(version: NetFXType; lcid: string): integer;
var
regVersion: cardinal;
begin
if (lcid <> '') then
lcid := '\' + lcid;
case version of
NetFx10:
//not supported
regVersion := -1;
NetFx11:
if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v1.1.4322' + lcid, 'SP', regVersion)) then
regVersion := -1;
NetFx20:
if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v2.0.50727' + lcid, 'SP', regVersion)) then
regVersion := -1;
NetFx30:
if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.0' + lcid, 'SP', regVersion)) then
regVersion := -1;
NetFx35:
if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.5' + lcid, 'SP', regVersion)) then
regVersion := -1;
NetFx40Client:
if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Client' + lcid, 'Servicing', regVersion)) then
regVersion := -1;
NetFx40Full:
if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Servicing', regVersion)) then
regVersion := -1;
NetFx45:
if (RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Release', regVersion)) then begin
if (regVersion = 379893) or (regVersion = 393295) then
regVersion := 2 // 4.5.2
else if (regVersion = 378675) or (regVersion = 378758) or (regVersion = 393295) then
regVersion := 1 // 4.5.1
else if (regVersion = 378389) or (regVersion = 393295) then
regVersion := 0 // 4.5.0
else
regVersion := -1;
end;
end;
Result := regVersion;
end;
Best regards.
|
|
|
|
|
|
Hi,
I think I found a problem in dotnetfxversion.iss!?
When the .NET Framework 4.6 is installed is not regVersion 379893 (4.5.2) but 393295 (4.6) by default.
Issue found here:
begin
RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Release', regVersion);
Result := (regVersion >= 378389) and (regVersion <= 379893);
Exit;
end;
And here:
if (RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Release', regVersion)) then begin
if (regVersion = 379893) then
regVersion := 2
else if (regVersion = 378675) or (regVersion = 378758) then
regVersion := 1
else if (regVersion = 378389) then
regVersion := 0
else
regVersion := -1;
end;
Best regards.
modified 4-Aug-15 10:31am.
|
|
|
|
|
Please add 2015 support.
http://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe
http://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe
|
|
|
|
|
|
This actually helped me with what Ive been researching and trying to achieve independently since the past few weeks. This is actually a total bundle of per-requisites to the application I'm currently building.
Thanks a lot.
|
|
|
|
|
Would it be difficult to add the VSTO 2010 runtime dependency?
|
|
|
|
|
|
Hello, I am using the the sample script and commented out all #define statements except for
use_dotnetfx45
use_vc2012
When I ran the setup file, it seems to have launched the .net45 installer but after a while it displayed the the .net command line syntax message
Usage: Setup[switches] ...
Any idea what is going wrong?
Thanks.
|
|
|
|
|
I've solved my problem.
There are two issues:
1. NET 4.5.1 Install only works when running on a UI session.
Remove /q switch (dotnetfx45.iss). More info here[^]
2. The url for vcredist2012 x86 is incorrect. It should be
vcredist_x86.exe not vcredist_x84.exe (vcredist2012.iss)
|
|
|
|
|
How can I handle the situation where my dependent installers have multiple files rather than a single installer? My system needs to install some hardware drivers, but the driver files have their own dependent ini files which must be in the same folder.
Thanks!
Nick
|
|
|
|
|
hello, can someone explain me in detail how to get the "installer" for dotnetfx40full working?. After 2 hours trying i still cant get it to work. What do i have to add to my installer to make it work :X please help me
|
|
|
|
|
Hi.
In the current version it will always install the client (smaller version)
To fix this. Remove the following code.
#ifdef use_dotnetfx40
if (not netfxinstalled(NetFx40Client, '') and not netfxinstalled(NetFx40Full, '')) then
dotnetfx40client();
#endif
and replace it with this.
#ifdef use_dotnetfx40
if (not netfxinstalled(NetFx40Full, '')) then
dotnetfx40full();
#endif
This should always install the full version even if the client version exists.
Thanks,
David Eaton
|
|
|
|
|
Another issue I just discovered while adding more comments to my setup file: You can't do this:
; Include 3rd-party software check and download support
#include "scripts\products.iss"
#include "scripts\products\stringversion.iss"
#include "scripts\products\winversion.iss"
#include "scripts\products\fileversion.iss"
#include "scripts\products\dotnetfxversion.iss"
; Include modules for required products
#include "scripts\products\msi31.iss"
#include "scripts\products\dotnetfx40client.iss"
#include "scripts\products\dotnetfx40full.iss"
#include "scripts\products\dotnetfx45.iss"
It tells you that ";" is not valid here. True, because the previous include files have left open the [Code] section and whatever comes next or is included next must cope with that forgotten state. Either by starting another section like [Files] or [Setup], or by continuing in code syntax. Comments must be prefixed with "//" here instead of ";".
My suggestion is to never leave any file in a [Code] section and never expect that a file is included in a [Code] section. Here's what I've modified in my files:
- Change "//" comments at the beginning of all files to ";" style.
- Insert the [Code] line at the top of each file that includes only code.
- Add a [Setup] line at the end of all files to revert to non-code syntax.
That way, you can always include any file without knowing how it's exactly structured.
|
|
|
|
|
According to my test, it has a bug that I spotted from reading the code in file "stringversion.iss". I also found this code elsewhere, with the same issue. It says:
1.0 is equal to 1.0.1
compareversion('1.0', '1.0.1') = 0
This doesn't seem exactly correct. The problem is that it just stops comparing whenever one version string has no more numbers. If one has more numbers than the other, they are ignored.
Can this be fixed somehow? I tried to rewrite the whole thing but soon quit again. My brain refuses to produce such low-level commands that were required with the available means. Not even arrays and a string split function available, not even dreaming of regular expressions...
Another requirement I'd have for my use is that it ignores anything after /[0-9.]+/. This isn't currently the case because it can only search for a "." and if the suffix is separated by something else, like in "1.0.1-test", it can only parse (1, 0) but not (1, 0, 1). I'd add a preprocessor for that to trim the version strings to any digits or a dot and stop as soon as I find another character.
I have a nice little C# implementation for all that, but still having trouble to fully correctly use it here (can't unload and delete my DLL anymore). Also, using a .NET DLL would somehow defeat the use of a script that can install .NET if it's not there... Pascal code is sooo weak (little power per code line) and lenghty compared to it.
modified 8-Feb-15 5:33am.
|
|
|
|
|
Thanks for all your work on this. I use InnoSetup, but I didn't realize you could set and install the dependencies. This will help a lot.
|
|
|
|
|
Nice article !
Is it possible to extend this to have a helper to install VSTO ?
Thanks.
Stephane Moinard - CTO at QUALNET - France
|
|
|
|
|
VSTO might depend on current user's profile, If anyone decides to push an app with a deployment tool that thing will work as admin account or system account, and the user part might be missing. Installing vsto that way might cause more troubles than resolves.
Andrzej Demski
IBM / Software Packaging
|
|
|
|
|
Thank you for this reply.
Stephane Moinard - CTO at QUALNET - France
|
|
|
|
|
Hi
I just stumbled across this after spending most of my Saturday trying to get this to type of thing to work - wish I had found it yesterday.
How can I add PowerShell 2 and SQL Native Client 11 to my list, I think I can work out the latter by checking for SQLNCLI11 in the registry, but I am unsure about PowerShell 2.
thanks for this, it has saved me from pulling ALL of my hair out.
Thx
D
|
|
|
|
|
|