问题
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;
来源:https://stackoverflow.com/questions/29771382/inno-setup-procedure-not-executing-after-install