[Files]
Source: D:\VBproject\YY\inst\YY.exe; DestDir: {app}; Flags: ignoreversion
Source: D:\VBproject\YY\inst\YY.dll; DestDir: {app}; Flags: ignoreversion
That is my file list above, and I want to install the YY.dll from the internet for example
http://www.example.com/yy.dll , not pack it to setup.exe
Is there any way can do that? Thanks alot
I have used the ISTool plugin:
#include 'C:\Program Files (x86)\ISTool\isxdl.iss'
[Code]
const
dotnetRedistURL = 'http://www.example.com/yy.dll ';
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
isxdl_AddFile(dotnetRedistURL, ExpandConstant('{app}\data\yy.dll'));
isxdl_SetOption('Updating', 'Updating to the latest DLL...');
isxdl_SetOption('Please wait...', 'Updating...');
isxdl_DownloadFiles(WizardForm.Handle);
end;
end;
Related
I know how to overwrite the files using this method
[Files]
Source: "Project\*"; DestDir: "{app}"; \
Flags: ignoreversion recursesubdirs onlyifdoesntexist; Permissions: everyone-full
But when I change the program using the Change option in 'Install Or Change Program' section I want to not overwrite the files.
I create the change option for my installer like this:
[setup]
AppModifyPath="{srcexe}" /modify=1
How do I do this?
First, your code seems wrong. With the onlyifdoesntexist flag, the files are never overwritten, contrary to what you claim. So for most purposes, simply using this flag will do.
Anyway, a solution is to create two [Files] entries, one that overwrites and one that does not. And use the Pascal scripting to pick the entry for a respective installation mode.
[Files]
Source: "Project\*"; DestDir: "{app}"; Flags: ... onlyifdoesntexist; Check: IsUpgrade
Source: "Project\*"; DestDir: "{app}"; Flags: ...; Check: not IsUpgrade
Example of IsUpgrade implementation:
[Code]
function IsUpgrade: Boolean;
var
S: string;
InnoSetupReg: string;
AppPathName: string;
begin
InnoSetupReg :=
'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppId")}_is1';
{ The ExpandConstant is here for Inno Script Studio, }
{ which generated AppId in a form of GUID. }
{ The leading { of the GUID has to be doubled in Inno Setup, }
{ and the ExpandConstant collapses that back to single {. }
InnoSetupReg := ExpandConstant(InnoSetupReg);
AppPathName := 'Inno Setup: App Path';
Result :=
RegQueryStringValue(HKLM, InnoSetupReg, AppPathName, S) or
RegQueryStringValue(HKCU, InnoSetupReg, AppPathName, S);
end;
See also Pascal scripting: Check parameters.
I have an XML file with some tags like names of DLL files.
I want a Inno Setup script code to install only files stated in the XML file (I can read from XML file).
My question is: How can I embed all DLL files and according to the XML file, I only install only the required files.
The idea I just need one XML for each release, and I never change the DLL files.
Use the Check parameter to programmatically decide if a certain file should be installed:
[Files]
Source: "Dll1.dll"; DestDir: "{app}"; Check: ShouldInstallDll1
Source: "Dll2.dll"; DestDir: "{app}"; Check: ShouldInstallDll2
[Code]
function ShouldInstallDll1: Boolean;
begin
Result := ???;
end;
function ShouldInstallDll2: Boolean;
begin
Result := ???;
end;
If it better suits your logic, you can also use a single "check" function and use the CurrentFileName magic variable, to test, if the file being installed, is the one you want to really install:
[Files]
Source: "Dll1.dll"; DestDir: "{app}"; Check: ShouldInstallDll
Source: "Dll2.dll"; DestDir: "{app}"; Check: ShouldInstallDll
[Code]
var
FileToInstall: string;
function InitializeSetup(): Boolean;
begin
FileToInstall := ??? { 'Dll1.dll' or 'Dll2.dll' based on the XML file }
Result := True;
end;
function ShouldInstallDll: Boolean;
var
Name: string;
begin
Name := ExtractFileName(CurrentFileName);
Result := (CompareText(Name, FileToInstall) = 0);
end;
The latter approach can be used, even if you pack files using a wildcard:
[Files]
Source: "*.dll"; DestDir: "{app}"; Check: ShouldInstallDll
I am continuing with my work in Inno Setup, So now I have a new questions about it.
I am trying of to execute some programs before install my final application, for this purpose I am using Exec function.
When I try with the following code:
[Files]
Source: "AccessDatabaseEngine_x64.exe"; DestDir: "{tmp}"; Flags: dontcopy noencryption
Source: "Database.accdb"; DestDir: "{app}"; Flags: ignoreversion
[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
Var
ResultCode: Integer;
begin
ExtractTemporaryFile('AccessDatabaseEngine_x64.exe');
if Exec(ExpandConstant('{tmp}\AccessDatabaseEngine_x64.exe'), 'quit', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
msgbox('True: {tmp}\AccessDatabaseEngine_x64.exe : ' + IntToStr(ResultCode), mbInformation, MB_OK);
end
else begin
msgbox('False: {tmp}\AccessDatabaseEngine_x64.exe : ' + SysErrorMessage(ResultCode), mbInformation, MB_OK);
end;
end;
I get this error:
On the other hand, if I use the follow code:
[Files]
Source: "AccessDatabaseEngine_x64.exe"; DestDir: "{tmp}"; Flags: dontcopy noencryption
Source: "Database.accdb"; DestDir: "{app}"; Flags: ignoreversion
[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
Var
ResultCode: Integer;
begin
ExtractTemporaryFile('AccessDatabaseEngine_x64.exe');
if Exec(ExpandConstant('{tmp}\AccessDatabaseEngine_x64.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
msgbox('True: {tmp}\AccessDatabaseEngine_x64.exe : ' + IntToStr(ResultCode), mbInformation, MB_OK);
end
else begin
msgbox('False: {tmp}\AccessDatabaseEngine_x64.exe : ' + SysErrorMessage(ResultCode), mbInformation, MB_OK);
end;
end;
I get the installation wizard of the another file. Some like this:
I want to install my other programs automatically, without user intervention.
Is it possible? Can you help me?
Thank for advance!
The usage screen says /quiet, and you use quit.
So use /quiet, not quit:
if Exec(ExpandConstant('{tmp}\AccessDatabaseEngine_x64.exe'), '/quiet', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
I was inattentive, the correct answer is in the first picture. The word that should be used is: /quiet; not /quite, not /quit.
As support (if this happens again to someone other) I leave the next link:
Description of the command-line switches that are supported by a software installation package, an update package, or a hotfix package that was created by using Microsoft Self-Extractor
.
Likewise many thaks for you attention.
The option needed is :
/passive Runs the update without any interaction from the user.
if Exec(ExpandConstant('{tmp}\AccessDatabaseEngine_x64.exe'), '/passive', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
I know how to overwrite the files using this method
[Files]
Source: "Project\*"; DestDir: "{app}"; \
Flags: ignoreversion recursesubdirs onlyifdoesntexist; Permissions: everyone-full
But when I change the program using the Change option in 'Install Or Change Program' section I want to not overwrite the files.
I create the change option for my installer like this:
[setup]
AppModifyPath="{srcexe}" /modify=1
How do I do this?
First, your code seems wrong. With the onlyifdoesntexist flag, the files are never overwritten, contrary to what you claim. So for most purposes, simply using this flag will do.
Anyway, a solution is to create two [Files] entries, one that overwrites and one that does not. And use the Pascal scripting to pick the entry for a respective installation mode.
[Files]
Source: "Project\*"; DestDir: "{app}"; Flags: ... onlyifdoesntexist; Check: IsUpgrade
Source: "Project\*"; DestDir: "{app}"; Flags: ...; Check: not IsUpgrade
Example of IsUpgrade implementation:
[Code]
function IsUpgrade: Boolean;
var
S: string;
InnoSetupReg: string;
AppPathName: string;
begin
InnoSetupReg :=
'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppId")}_is1';
{ The ExpandConstant is here for Inno Script Studio, }
{ which generated AppId in a form of GUID. }
{ The leading { of the GUID has to be doubled in Inno Setup, }
{ and the ExpandConstant collapses that back to single {. }
InnoSetupReg := ExpandConstant(InnoSetupReg);
AppPathName := 'Inno Setup: App Path';
Result :=
RegQueryStringValue(HKLM, InnoSetupReg, AppPathName, S) or
RegQueryStringValue(HKCU, InnoSetupReg, AppPathName, S);
end;
See also Pascal scripting: Check parameters.
I have compiled multiple programs in inno setup i.e
Sql Server
.Net framework 3.5
Crystal Reports
Sql Script
the problem i am facing is that the procedure in which the code of executing the script is present does not execute after the installation of a program before it. If the program before it is cancelled then it execute.
[Files]
Source: "E:\Inno Data\Inno_Setup\Prerequisites\dotnetfx35\NDP451-KB2858728-x86-x64-AllOS-ENU.exe"; DestDir: {tmp}; AfterInstall: InstallFramework
Source: "E:\Inno_Setup\Prerequisites\CrystalReports105\CRRuntime_64bit_13_0_5.msi"; DestDir: {tmp}; AfterInstall: InstallCrystalReports
Source: "E:\Prerequisites\SQLServer2008R2SP2\SQLEXPRWT_x64_ENU.exe"; DestDir: {tmp}
;SQL Script Files
Source: "E:\SQLInstallTEST\Scripts\RCabSoft.sql"; DestDir:"{app}\Scripts"
[Run]
Filename: "{tmp}\SQLEXPRWT_x64_ENU.exe"; Parameters: "/ACTION=Install /INSTANCENAME=MSSQLSERVER /QS /HIDECONSOLE /INDICATEPROGRESS=""False"" /IAcceptSQLServerLicenseTerms /SQLSVCACCOUNT=""NT AUTHORITY\SYSTEM"" /SQLSYSADMINACCOUNTS=""builtin\users"" /SKIPRULES=""RebootRequiredCheck"" "; Check: isWin64();
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\CRRuntime_64bit_13_0_5.msi"" /qb"; WorkingDir: {tmp};
Filename: "{tmp}\NDP451-KB2858728-x86-x64-AllOS-ENU.exe"; parameters: "/SILENT /NOCANCEL"; AfterInstall: sqlscript;
[Code]
procedure sqlscript;
var
ResultCode: Integer;
OutputText: String;
begin
if FileExists(ExpandConstant('{pf32}\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SSMS.exe')) then
begin
ExtractTemporaryFile('RCabSoft.sql');
// Execute SQL Update Scripts
Exec('SqlCmd.exe', ' -e -E -S .' + ExpandConstant(' -i "{tmp}\RCabSoft.sql"'), '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
end;