|
I've added a new product script called vcredist2008.iss - what is yet missing is proper detection by registry key, though. This is different to VC++ 2010 (numerous keys and versions possible as far as I can see). I tried to workaround this by using the '/q' switch so that no "repair" dialog occurs if already installed. Still, improvements would be welcome:
// requires Windows 7, Windows 7 Service Pack 1, Windows Server 2003 Service Pack 2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2008 R2 SP1, Windows Vista Service Pack 1, Windows XP Service Pack 3
// requires Windows Installer 3.1 or later
// requires Internet Explorer 5.01 or later
// http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9cfb2d51-5ff4-4491-b0e5-b386f32c0992
[CustomMessages]
vcredist2008_title=Visual C++ 2008 Redistributable
en.vcredist2008_size=3.9 MB
de.vcredist2008_size=3,9 MB
en.vcredist2008_size_x64=4.7 MB
de.vcredist2008_size_x64=4,7 MB
en.vcredist2008_size_ia64=4.0 MB
de.vcredist2008_size_ia64=4,0 MB
;http://www.microsoft.com/globaldev/reference/lcid-all.mspx
en.vcredist2008_lcid=''
de.vcredist2008_lcid='/lcid 1031 '
[Code]
const
vcredist2008_url = 'http://download.microsoft.com/download/0/a/5/0a5ce308-1e15-4806-964c-72dbf88de86d/vcredist_x86.exe';
vcredist2008_url_x64 = 'http://download.microsoft.com/download/4/a/9/4a932a53-ab98-44d9-af39-75491eb20006/vcredist_x64.exe';
vcredist2008_url_ia64 = 'http://download.microsoft.com/download/c/9/4/c9494e23-6717-47c3-a061-3cc2ce5453f8/vcredist_IA64.exe';
procedure vcredist2008();
var
version: cardinal;
begin
//RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\' + GetString('x86', 'x64', 'ia64'), 'Install', version);
//if (version <> 1) then
AddProduct('vcredist2008' + GetArchitectureString() + '.exe',
CustomMessage('vcredist2008_lcid') + '/q /passive /norestart',
CustomMessage('vcredist2008_title'),
CustomMessage('vcredist2008_size' + GetArchitectureString()),
GetString(vcredist2008_url, vcredist2008_url_x64, vcredist2008_url_ia64),
false, false);
end;
|
|
|
|
|
for now I've changed the procedure as follows:
procedure vcredist2008();
var
version: cardinal;
MS, LS: Cardinal;
begin
//RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\' + GetString('x86', 'x64', 'ia64'), 'Install', version);
//if (version <> 1) then
if GetVersionNumbers(ExpandConstant('{sys}\msvcr90.dll'), MS, LS) = false and GetVersionNumbers('msvcr90.dll', MS, LS) = false then
AddProduct('vcredist2008' + GetArchitectureString() + '.exe',
CustomMessage('vcredist2008_lcid') + '/q /passive /norestart',
CustomMessage('vcredist2008_title'),
CustomMessage('vcredist2008_size' + GetArchitectureString()),
GetString(vcredist2008_url, vcredist2008_url_x64, vcredist2008_url_ia64),
false, false);
end;
|
|
|
|
|
Message Closed
modified 23-Dec-20 12:54pm.
|
|
|
|
|
Hm, actually I wanted to avoid using product codes, as they potentially change between CPU architetures and service packages - but for my installer it doesn't matter.
I've "fixed" that now by migrating to VC++ 10 (2010) - but ran into another issue.
Will do a separate post with topic "Detecting/Installing VC++ 2010 Runtime".
|
|
|
|
|
Does anyone perhaps know of a script for installing SP1/SP2/SP3 (Windows XP)?
I am also looking for scripts for (in order of importance):
1) MS security essentials
2) Flash Player
3) VLC (with all plugins)
4) adobe reader X
5) KLITE coded pack
6) Java JRE
Any help would be much appreciated.
|
|
|
|
|
Does inno have any dependancies itself?
To be specific, lets say I have a newly installed vanilla xp without any SPacks, will Inno script run or not?
|
|
|
|
|
It works on vanilla XP without windows installer and/or any installed frameworks, just checked.
|
|
|
|
|
Can I install a dependency according to the selected components?
For example, you select Component 1 then install Framework 4.0, otherwise it not install.
Thank you very much, excellent work.
|
|
|
|
|
I'm interested in this too.
Has anybody a solution for it?
Thanks
Freddy
|
|
|
|
|
Ok, I have a developed a solution for this problem:
1. Add to isxdl.iss:
procedure isxdl_ClearFiles();
external 'isxdl_ClearFiles@files:isxdl.dll stdcall';
2. Add to products.iss:
procedure ClearProducts();
begin
isxdl_ClearFiles();
SetArrayLength(products, 0);
installMemo := '';
downloadMemo := '';
downloadMessage := '';
delayedReboot := false;
end;
3. Modify NextButtonClick in products.iss:
- Rename method to: function OnWpReadyPage(): boolean;
- Remove: if CurPageID = wpReady then begin ... end; block
4. Add to your project.iss:
function NextButtonClick(CurPageID: Integer): boolean;
begin
Result := true;
if CurPageID = wpSelectComponents then
begin
ClearProducts();
if(WizardForm.Componentslist.Checked[0]) then
begin
if (not netfxinstalled(NetFx40Full, '')) then
dotnetfx40fullstandalone();
end;
end;
if CurPageID = wpReady then
begin
Result := OnWpReadyPage();
end;
end;
Hope this fits to your problem.
Freddy
|
|
|
|
|
Very useful and illustrative.
|
|
|
|
|
Excellent job.
Thanks for sharing!
|
|
|
|
|
|
Dear Sir or Madam,
I'm following along with the script that was written to install the VC++ 2010 re-distributables on a machine (vcredist2010.iss). I don't need to actually have my Inno script perform the installation, only check if the re-distributables are already installed or not. I thought that the following code would do this on my Windows 7 machine:
procedure IsVCRedistDetected();
var
version: cardinal;
begin
RegQueryDWordValue(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\Visual Studio\10.0\VC\VCRedist\x86', 'Install', version);
if (version <> 1) then begin
MsgBox('VC++ 2010 files not installed.', mbInformation, MB_OK);
end else begin
MsgBox('VC++ 2010 files are installed.', mbInformation, MB_OK);
end;
end;
Note that when I check my Windows registry that the location of the re-distributables is different than indicated in your script. In any event, is there any dumb mistake that I'm making with this code that would cause my script to hang during execution? Thank you for your help!
but it seems to hang my script.
|
|
|
|
|
I also had some problems detecting whether the VC++ 2010 redistributables are installed or not. I'm now using the MsiQueryProductState function and the registry location to find out if they installed. I assume, that the redistriutables are installed when either the registry or the MsiQuery indicates that they are installed.
Code to use MsqiQueryProductState:
function MsiQueryProductState(ProductCode: string): integer;
external 'MsiQueryProductStateW@msi.dll stdcall';
const
INSTALLSTATE_DEFAULT = 5;
INSTALLLEVEL_MAXIMUM = $ffff;
INSTALLSTATE_ABSENT = 2;
INSTALLSTATE_ADVERTISED = 1;
INSTALLSTATE_INVALIDARG = -2;
INSTALLSTATE_UNKNOWN = -1;
Code to check if x64 redistributables are installed:
var
version: cardinal;
msi : integer;
msisp1 : integer;
begin
msi := MsiQueryProductState('{DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}');
msisp1 := MsiQueryProductState('{1D8E6291-B0D5-35EC-8441-6616F567A0F7}');
RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64', 'Install', version);
if ((version <> 1) and (msi <> INSTALLSTATE_DEFAULT) and (msisp1 <> INSTALLSTATE_DEFAULT)) then
# x64 redistributables installed
Code to check if x86 redistributables are installed:
var
version: cardinal;
msi : integer;
msisp1 : integer;
begin
msi := MsiQueryProductState('{196BB40D-1578-3D01-B289-BEFC77A11A1E}');
msisp1 := MsiQueryProductState('{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}');
RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86', 'Install', version);
if ((version <> 1) and (msi <> INSTALLSTATE_DEFAULT) and (msisp1 <> INSTALLSTATE_DEFAULT)) then
# x86 redistributables installed
Both versions succeed if the 'normal' VC++ 2010 redistributables or the sp1 versions are installed.
SP1 und "Non-SP1" redistributables create the same registry key but they have different product codes
|
|
|
|
|
InnoSetup is such a great tool, it's nice to see work like yours that make it even more flexible.
|
|
|
|
|
In scripts\products\wic.iss, line 42 has a bug:
if (not isIA64()) then begin
Should be changed to:
if (not IsIA64()) then begin.
When testing on Windows Server 2003 x86, this condition does not properly evaluate to True.
|
|
|
|
|
Hello,
Please correct me if I'm wrong:
(My software uses third-party components (dll and ocx) compiled with Visual C++ x86)
So I guess that I have to install Visual C++ Redistributable x86 version.
Even if the architecture (target computer) version is x64, isn't it!?
If I'm wrong here, you can stop reading and just kindly tell me I'm wrong
But if I'm right, the VC++ redistributable script should not make a choice (x86 or x64) based on the target computer OS type but with a specific argument telling which version is needed to run the software and/or its components! Am I right?
Thanks for reading and in advance for you answers/points of view!
modified 23-Nov-11 5:45am.
|
|
|
|
|
Still no "answer"... ?
|
|
|
|
|
Did you got your answer? If so please share.
|
|
|
|
|
my experience is also that for my program f.ex. it is enough to install the x86 version on my windows 7 x66 bit machine to make the program work.
|
|
|
|
|
In versions of Windows that do not have WIC and Framework 4.0. First try to install the Framework and then the WIC. But never can install the Framework, as it requires WIC.
I solved by changing the order in setup.iss:
Look:
#ifdef use_wic
wic();
#endif
// if no .netfx 4.0 is found, install the client (smallest)
#ifdef use_dotnetfx40
if (not netfxinstalled(NetFx40Client, '') and not netfxinstalled(NetFx40Full, '')) then
dotnetfx40client();
#endif
|
|
|
|
|
|
This is a fantastic article, thanks a lot!
I'm trying to change the code slightly, so I can have just a single .exe file and no dependencies folder. I have tried to put the dependency files into the [Files] section and to extract them to a temporary subfolder in the {app} location, but get this error:
"an attempt was made to expand the "app" constant before it was initialized"
In products.iss:
This is the line I changed from AddProducts:
path := ExpandConstant('{app}{\}') + CustomMessage('DependenciesDir') + '\' + FileName;
and the [Files] section
[Files]
Source: "scripts\isxdl\german2.ini"; Flags: dontcopy
Source: "src\dotnetfx20.exe"; DestDir: "{app}\Dependencies"; Flags: deleteafterinstall
Source: "src\dotnetfx20sp2.exe"; DestDir: "{app}\Dependencies"; Flags: deleteafterinstall
Source: "src\vc08redistsp1.exe"; DestDir: "{app}\Dependencies"; Flags: deleteafterinstall
thanks for any help!
|
|
|
|
|
Message Closed
modified 23-Dec-20 12:39pm.
|
|
|
|
|