Inno Setup Procedure not executing after install

瘦欲@ 提交于 2019-12-13 07:43:50

问题


I have compiled multiple programs in inno setup i.e

  1. Sql Server
  2. .Net framework 3.5
  3. Crystal Reports
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!