Scripts de Inno Setup

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{4E004BF5-F7B8-4D38-A9EB-9DC896A3B995}
AppName=PHP 5.6 and extra files
AppVersion=1.0
AppVerName=PHP Installation 1.0
AppPublisher=local publisher
AppPublisherURL=localhost
AppSupportURL=localhost
AppUpdatesURL=localhost
DefaultDirName={pf}\PHP\v5.6
DefaultGroupName=PHP 5.6 and extra files
AllowNoIcons=yes
OutputDir=C:\TEMP
OutputBaseFilename=PHP 5.6 and extra filesl
Password=1234
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Code]
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', OrigPath)
then begin
Result := True;
exit;
end;
{ look for the path with leading and trailing semicolon }
{ Pos() returns 0 if not found }
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};C:\Program Files (x86)\PHP\v5.6"; Check: NeedsAddPath('C:\Program Files (x86)\PHP\v5.6')

[Files]
Source: "C:\Program Files (x86)\PHP\v5.6*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\TEMP\software*"; DestDir: "C:\TEMP\software\"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "vcredist_x86.exe"; DestDir: {tmp}; Flags: deleteafterinstall
Source: "vcredist_x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall
Source: "msodbcsql.msi"; DestDir: {tmp}; Flags: deleteafterinstall

[Run]
Filename: "{tmp}\vcredist_x86.exe ";Parameters:/SILENT;
Filename: "{tmp}\vcredist_x64.exe ";Parameters:/SILENT;
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\msodbcsql.msi"" IACCEPTMSODBCSQLLICENSETERMS=YES /qb"; WorkingDir: {tmp};

[Setup]
AlwaysRestart = yes

Accede o Regístrate para comentar.