|
Thanks for sharing ! Great job.
|
|
|
|
|
When the wic exe is provided the script appears to insist on downloading it anyway. I did a little digging and the '_x86' is not getting inserted into the filename because it uses GetArchitectureString which returns empty string for x86. To get around it I just created a 2nd version of GetArchitectureString that returns '_x86' and used that version in the wic script. Not sure if there is a similar problem in other scripts, only noticed it today when doing an install CD that included wic. I suppose I could have also just removed the '_x86' from the wic installers I downloaded. Anyway I thought I should mention it in case someone else hit upon it.
function GetArchitectureString(): String;
begin
if IsX64() then begin
Result := '_x64';
end else if IsIA64() then begin
Result := '_ia64';
end else begin
Result := '';
end;
end;
function GetArchitectureStringWithX86(): String;
begin
if IsX64() then begin
Result := '_x64';
end else if IsIA64() then begin
Result := '_ia64';
end else begin
Result := '_x86';
end;
end;
procedure wic();
begin
if (not IsIA64()) then begin
//only needed on Windows XP SP2 or Windows Server 2003
if ((exactwinversion(5, 1) and exactwinspversion(5, 1, 2)) or (exactwinversion(5, 2))) then begin
if (not FileExists(GetEnv('windir') + '\system32\windowscodecs.dll')) then
AddProduct('wic' + GetArchitectureStringWithX86() + '_' + GetConvertedLanguageID() + '.exe',
'/q',
CustomMessage('wic_title'),
CustomMessage('wic_size'),
GetString(wic_url, wic_url_x64, '') + GetConvertedLanguageID() + '.exe',
false, false);
end;
end;
end;
|
|
|
|
|
Message Closed
modified 23-Dec-20 12:37pm.
|
|
|
|
|
Yes, since it didn't appear it the readme list I had assumed it would work with the default names directly off the microsoft website. An updated readme with the expected wic name formats would be helpful. Thank you.
Edit: Perhaps if there is a general rule about removing 'x86' from installer names, that should also be noted in the readme as well. Looking back at the readme, I should perhaps have noticed the implied rule via the pattern in the naming.
|
|
|
|
|
I tried your script.
Its not installing silently.
Its needed user interaction for .Net Framework 4.0 & VC 2010.
modified 29-Jul-14 3:22am.
|
|
|
|
|
Hello,
your .net framework installation script save my time.
can you help me to install crystal Report Runtime from Web ?
thanks
Kalpesh
|
|
|
|
|
This will install the VC Runtime 2012 Update 4.
[CustomMessages]
vcredist2012_title=Visual C++ 2012 Redistributable
en.vcredist2012_size=6.3 MB
de.vcredist2012_size=6,3 MB
en.vcredist2012_size_x64=6.4 MB
de.vcredist2012_size_x64=6,4 MB
;There isn't an IA64 version :(
;http://www.microsoft.com/globaldev/reference/lcid-all.mspx
en.vcredist2012_lcid=''
de.vcredist2012_lcid='/lcid 1031 '
[Code]
const
vcredist2012_url = 'http:
vcredist2012_url_x64 = 'http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe';
procedure vcredist2012();
var
version: cardinal;
begin
RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\11.0\VC\Runtimes\' + GetString('x86', 'x64', ''), 'Installed', version);
if (version <> 1) then
AddProduct('vcredist2012' + GetArchitectureString() + '.exe',
CustomMessage('vcredist2012_lcid') + '/passive /norestart',
CustomMessage('vcredist2012_title'),
CustomMessage('vcredist2012_size' + GetArchitectureString()),
GetString(vcredist2012_url, vcredist2012_url_x64, ''),
false, false);
end;
EDIT: Fixed wrong version in registry key.
What do you get when you cross a joke with a rhetorical question?
modified 21-Jun-14 11:21am.
|
|
|
|
|
Message Closed
modified 23-Dec-20 12:37pm.
|
|
|
|
|
If you don't have the ArchitecturesInstallIn64BitMode option set, the install will always be x86, so Is64BitInstallMode will be false , causing all methods that get strings/filenames/etc to return the x86 version.
I have tested this, and it works (I accidentally deleted the script I used to test while cleaning out some files on my HDD, so I can't share it). I am not sure why it didn't work for the person that first reported this, as this isn't really an issue, as InnoSetup takes care of it for us.
What do you get when you cross a joke with a rhetorical question?
|
|
|
|
|
Something about the path for the x86 redistributable:
the constant: vcredist2012_url is pointing to the file vcredist_x84.exe and the correct one is: vcredist_x86.exe
|
|
|
|
|
I'd vote this higher if I could
It is superb and so very well organised.
It was such a pain trying to get .NET installed before I found this, now it's a breeze.
|
|
|
|
|
i like to know Is it free for commercial use ??
tbhattacharjee
|
|
|
|
|
|
How to install prerequisite without showing any dialog box which say (The following applications are required before setup can continue)
I want to make a setup that will search and install without asking.
I need to install .net client profile without asking the user to install.
Can you tell me how to do that
|
|
|
|
|
Does this script install the .NET Client Profile or the .NET 4 Full install?
I can't see where (or why) it chooses and the #define statement seems to encompass both.
Thanks,
Nick
|
|
|
|
|
Hi,
i tried to install the MyProgram setup.
in last step of installation its showing, "Download Dependencies Windows installer and SQL Server r2"
then i click next button. the progress bar running and showing file downloading then its shows successfully installed. but the windows installer and sql server is not installed in my PC.
Can any one help me ?is any where i need to change the code.
Thanks
karthik
|
|
|
|
|
Hello man. Thank you for this script so good!
I have a doubt about the terms
#define use_dotnetfx11
#define use_dotnetfx11lp
.....
In the examples of define term we used, see
#define MyAppName "My Program"
#define MyAppVer GetFileVersion("MyProg.exe")
But the use_dotnetfx11 there is not a value setted...
as:
#define use_dotnetfx11lp = "??????"
And my pascal code I have:
#ifdef use_dotnetfx11
dotnetfx11();
#ifdef use_dotnetfx11lp
dotnetfx11lp();
#endif
dotnetfx11sp1();
#endif
How does it know that use_dotnetfx11 is true or false?
Is the right way?
|
|
|
|
|
I finished my project in vb.net.
What do I need to have in order to run this tool properly (beside my exe and database)?
Do I need all the Dlls & Ocxs?
Do I need to specify which framework I'm using?
Is it possible to get into details of how to use it with an example?
Thank you
Ami
Israel
|
|
|
|
|
Hi... First of all, I want to thank you very much because this post help me a lot. But somehow i still confused about the dependencies file. I need to include microsoft installer 3.1. I delved into the msi31.iss file and find out that if the file is not found, the setup will download the msi31 from the internet.
I've got the msi31 installer from visual studio. The name was "WindowsInstaller-KB893803-v2-x86.exe". And in the msi31.iss file, there was "AddProduct('msi31.exe', " line. should i modify the line or the file name, or perhaps i should not?
Thanks
|
|
|
|
|
Message Closed
modified 23-Dec-20 12:37pm.
|
|
|
|
|
I've done that with vcredist2015.exe and the file isn't included in the installer. Do I need to add it manually to the installer or should it be included automatically?
|
|
|
|
|
Very useful and clear. Thanks a lot!
|
|
|
|
|
Hi
Is there a way to use your scripts to install the .Net Framework on e.g. a Win Server 2008 R2/2012? As you must use the Role Manager, the current scripts don't work for me.
Thank you and thanks for your great project!
|
|
|
|
|
this powershell script does the job (you need to specifiy the Dotnet-Setup Url):
Param($computer = "localhost")
Function Get-OSVersion($computer,[ref]$feature)
{
$os = Get-WmiObject -class Win32_OperatingSystem -computerName $computer
Switch ($os.Version)
{
"6.1.7600"
{
If($os.ProductType -ne 1) #only 2008R2
{
$feature.value = "NET-FRAMEWORK"
} #end if
} #end 7600
"6.2.9200"{
If($os.ProductType -ne 1) #only 2012
{
$feature.value = "NET-FRAMEWORK-Core"
} #end if
}
DEFAULT { $feature.value = ""}
} #end switch
} #end Get-OSVersion
# *** entry point to script ***
$feature = $null
Get-OSVersion -computer $computer -feature ([ref]$feature)
$x = Read-Host 'Installing .Net Framework. Do you want to continue? (y/n)'
if ($x -like 'y')
{
if ($feature.value -ne "")
{
$wc = New-Object System.Net.WebClient
$fullPathIncFileName = $MyInvocation.MyCommand.Definition
$currentScriptName = $MyInvocation.MyCommand.Name
$currentExecutingPath = $fullPathIncFileName.Replace($currentScriptName, "")
$wc.DownloadFile(<DOTNETDOWNLOADURL>, "$currentExecutingPath\dotnetfx35setup.exe")
Install-WindowsFeature -name $feature -source dotnetfx35setup.exe
}
}
else
{
exit 1;
}
|
|
|
|
|
Hi,
sorry, can't ge this to work.
We are using "dism" instead:
edit products.iss:
[Code]
const sFeatureInstall='featureinstall';
procedure AddProduct(FileName, Parameters, Title, Size, URL: string; InstallClean : boolean; MustRebootAfter : boolean);
var
path: string;
i: Integer;
begin
installMemo := installMemo + '%1' + Title + #13;
path := ExpandConstant('{src}{\}') + CustomMessage('DependenciesDir') + '\' + FileName;
if (not FileExists(path)) and not (URL = '') then
begin
path := ExpandConstant('') + FileName;
isxdl_AddFile(URL, path);
downloadMemo := downloadMemo + '%1' + Title + #13;
downloadMessage := downloadMessage + ' ' + Title + ' (' + Size + ')' + #13;
end;
i := GetArrayLength(products);
SetArrayLength(products, i + 1);
// special treatment for bug #11483
if (LowerCase(FileName) = sFeatureInstall) then
products[i].File := sFeatureInstall
else
products[i].File := path;
products[i].Title := Title;
products[i].Parameters := Parameters;
products[i].InstallClean := InstallClean;
products[i].MustRebootAfter := MustRebootAfter;
end;
function SmartExec(prod : TProduct; var ResultCode : Integer) : boolean;
var
showFlag: Integer;
OldState: Boolean;
begin
showFlag := SW_SHOWNORMAL;
//install OS feature (like on server 2008R2 and server 2012, e.g. NetFx3)
if (LowerCase(prod.File) = sFeatureInstall) then
begin
OldState := EnableFsRedirection(False);
try
showFlag := SW_HIDE; //SW_HIDE command line window
Result := Exec(ExpandConstant(''),'/C dism /NoRestart /Online /Enable-Feature:'+prod.Parameters+' /all', '',showFlag, ewWaitUntilTerminated, ResultCode);
finally
EnableFsRedirection(OldState);
end;
end
else
begin//no feature install
if (LowerCase(Copy(prod.File,Length(prod.File)-2,3)) = 'exe') then
begin
Result := Exec(prod.File, prod.Parameters, '', showFlag, ewWaitUntilTerminated, ResultCode);
end
else
begin
Result := ShellExec('', prod.File, prod.Parameters, '', showFlag, ewWaitUntilTerminated, ResultCode);
end;
end;//no feature install
end;
edit dotnetfx35sp1.iss
procedure dotnetfx35sp1();
var
params: string;
begin
if (netfxspversion(NetFx35, '') < 1) then
begin
if (IsWin2012) or (IsWin2008R2) then
begin
params := 'NetFx3';
AddProduct(sFeatureInstall,
params,
CustomMessage('dotnetfx35sp1_title'),
CustomMessage('dotnetfx35sp1_size'),
dotnetfx35sp1_url,
false, false);
end
else
AddProduct('dotnetfx35sp1' + GetArchitectureString() + '.exe',
'/lang:enu /passive /norestart',
CustomMessage('dotnetfx35sp1_title'),
CustomMessage('dotnetfx35sp1_size'),
dotnetfx35sp1_url,
false, false);
end;
end;
|
|
|
|
|