Commit ad885839 authored by lijingang's avatar lijingang

fix:add

parent 56212d62
; 脚本由 Inno Setup 脚本向导 生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!
#include AddBackslash( CompilerPath ) + "ISPPBUILTINS.ISS"
#define MyAppName "审计软件升级程序"
; MyAppRegName 名称应保持与Config.ini中APPRegName配置一致,否则注册表读写不对应。
#define MyAppRegName4 "UFCPAS4"
#define MyAppExeName4 "UFCPAS4.exe"
#define MyAppRegName6 "CPAS6"
#define MyAppEnName6 "CPAS6"
#define MyAppExeName6 "cpas-WorkPlatform.exe"
#define MyAppVersion "6.0.250306"
#define MyAppPublisher "北京友数聚科技有限公司"
#define MyAppURL "http://www.youdatasum.com/"
#define SQL_Path "C:\AudSQL2014"
#define SQL_INSTANCE "MSSQL$AudSQL2014"
#define SQL_ServerName "(local)\AudSQL2014"
#define CurDateString GetDateTimeString('yyMMdd', '-', ':');
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{UFAUD001-498E-44A3-BFE8-FBC48803XAuto}
AppName={#MyAppName}
AppVersion=6.0.{#CurDateString}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
DefaultDirName={code:GetDefaultDir}
;D:\{#MyAppEnName}
DefaultGroupName={#MyAppName}
CreateAppDir=true
;OutputBaseFilename={#MyAppName}Setup-{#CurDateString} OutputBaseFilename=AutoUpdate
OutputDir=E:\CPAS6-101 UFCPAS6.0 致同智审IAS版_测试版\AutoUpdate\
;lzma 压缩方式 lzma2/fast none
compression=lzma
;是否使用原来的安装路径,不让选择
UsePreviousAppDir=no
DisableDirPage=yes
SolidCompression=yes
Uninstallable=no
DisableReadyPage=yes
EnableDirDoesntExistWarning=no
DirExistsWarning=no
AlwaysShowGroupOnReadyPage=yes
DisableProgramGroupPage=yes
[Files]
;6.0项目管理工具与审计作业平台未分成两个EXE;
Source: "{#MyAppExeName6}"; DestDir: "{app}"; Flags: ignoreversion;
Source: "{#MyAppExeName4}"; DestDir: "{app}"; Flags: ignoreversion;
Source: "AutoUpdate\update.inf"; DestDir: "{app}\AutoUpdate";
;Source: "ConfigTool.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "CpasCloudSvr\CpasCloudSvr.exe"; DestDir: "{app}\CpasCloudSvr"; Flags: ignoreversion;
Source: "CpasCloudSvr\data\*"; DestDir: "{app}\CpasCloudSvr\data"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "AutoUpdateClient.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "1,68-A8-6D-14-57-9E.CPA"; DestDir: "{app}"; Flags: ignoreversion
;Source: "WorkPaperViewer.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "RegWorkPaperViewer.bat"; DestDir: "{app}"; Flags: ignoreversion
;Source: "CPAProjectSynchron.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "UFHSPSystem.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "FTPClient.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "CPASProtocol.exe"; DestDir: "{app}"; Flags: ignoreversion;
;Source: "borlndmm.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "UFCPASSetupDll.dll"; DestDir: "{app}\"; Flags: ignoreversion dontcopy
Source: "重启资源管理器.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "AppBPL\*"; DestDir: "{app}\AppBPL"; Flags: ignoreversion recursesubdirs createallsubdirs ;
Source: "Config\Config.ini"; DestDir: "{app}\Config"; Flags: ignoreversion
Source: "Config\Config.xml"; DestDir: "{app}\Config"; Flags: ignoreversion
Source: "Config\ExportExcel.xml"; DestDir: "{app}\Config"; Flags: ignoreversion
;Source: "Config\ServerConfig.ini"; DestDir: "{app}\Config"; Flags: ignoreversion
;Source: "Config\Symbol.ini"; DestDir: "{app}\Config"; Flags: ignoreversion
;Source: "Config\*"; DestDir: "{app}\Config"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "Data\*"; DestDir: "{app}\Data"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "SysBPL\*"; DestDir: "{app}\SysBPL"; Flags: ignoreversion recursesubdirs createallsubdirs
; 不能添加 Source: "SourceData\*"; DestDir: "{app}\SourceData"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "数据采集工具\*"; DestDir: "{app}\数据采集工具"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "演示数据\*"; DestDir: "{app}\演示数据"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "AppData\*"; DestDir: "{app}\AppData"; Flags: ignoreversion recursesubdirs createallsubdirs
;ProjectData文件夹内有演示企业的底稿文件,数据库初始化工具不能回复,暂时直接恢复;
;Source: "ProjectData\*"; DestDir: "{app}\ProjectData"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "DataConvert\*"; DestDir: "{app}\DataConvert"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "DBUpdate\*"; DestDir: "{app}\DBUpdate"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "升级包数据库升级脚本\*"; DestDir: "{app}\DBUpdate\Script\"; Flags: ignoreversion recursesubdirs createallsubdirs
;注册Office加载项,[run]段也加入bat文件注册双保险
;Source: "DataConvert\Dts_dll\dtspkg.dll"; DestDir: "{app}\DataConvert\Dts_dll"; DestName: "dtspkg.dll"; Flags: regserver noregerror;
;Source: "DataConvert\Dts_dll\dtspump.dll"; DestDir: "{app}\DataConvert\Dts_dll"; DestName: "dtspump.dll"; Flags: regserver noregerror;
;Office加载项换成新方式
Source: "VSTO\*"; DestDir: "{app}\VSTO"; Flags: ignoreversion recursesubdirs createallsubdirs;
Source: "UFCPAS4Office\UFSY4Protocol.exe"; DestDir: "{app}\UFCPAS4Office"; Flags: ignoreversion recursesubdirs createallsubdirs;BeforeInstall: ClearTargetDir(ExpandConstant('{app}\UFCPAS4Office'))
;注册Office加载项,[run]段也加入bat文件注册双保险 ;Source: "UFCPAS4Office\libeay32.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "libeay32.dll"; Flags: regserver noregerror; ;Source: "UFCPAS4Office\ssleay32.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "ssleay32.dll"; Flags: regserver noregerror;
;注册Office加载项,[run]段也加入bat文件注册双保险 ;Source: "UFCPAS4Office\UFCPAS4Office-32.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFCPAS4Office.dll"; Flags: regserver noregerror; Check: not IsOffice64 ;Source: "UFCPAS4Office\UFCPAS4Office-64.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFCPAS4Office.dll"; Flags: regserver noregerror; Check: IsOffice64
;注册UFSYA.ocx,[run]段也加入bat文件注册双保险 ;Source: "UFCPAS4Office\UFSYA-32.ocx"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFSYA-32.ocx"; Flags: regserver noregerror 32bit; ;Source: "UFCPAS4Office\UFSYA-64.ocx"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFSYA-64.ocx"; Flags: regserver noregerror 64bit; Check: IsWin64
;Source: "UFCPAS4Office\UFCPAS4Office-32.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFCPAS4Office-32.dll"; Flags: regserver noregerror 32bit;
;Source: "UFCPAS4Office\UFCPAS4Office-64.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFCPAS4Office-64.dll"; Flags: regserver noregerror 64bit; Check: IsWin64
Source: "Tools\cpas-office-tools.exe"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\cpas-report-office-addin.msi"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\cpasReport.msi"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\TBAnalyisi.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\template.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\DateSet.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\dg.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\dgfj.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\BatchRefresh\Cpas6DgBatchRefresh.exe"; DestDir: "{app}\Tools\BatchRefresh"; Flags: ignoreversion recursesubdirs createallsubdirs
;UFCPAS6.0新增
;Source: "AppData\Files\报告模板\*"; DestDir: "{app}\AppData\Files\报告模板\"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "AppData\Files\底稿模板\*"; DestDir: "{app}\AppData\Files\底稿模板\"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "Tools\cpas-office-tools.exe"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "cpas-apps\*"; DestDir: "{app}\cpas-apps"; Flags: ignoreversion recursesubdirs createallsubdirs ;Source: "cpas-apps\db-config.json"; DestDir: "{app}\cpas-apps"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "cpas-apps\app-config.json"; DestDir: "{app}\cpas-apps"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "cpas-apps\user-config.json"; DestDir: "{app}\cpas-apps"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "locales\zh-CN.pak"; DestDir: "{app}\locales"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "locales\en-US.pak"; DestDir: "{app}\locales"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "locales\zh-TW.pak"; DestDir: "{app}\locales"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "resources\*"; DestDir: "{app}\resources"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "libeay32.dll"; DestDir: "{app}"; Flags: regserver noregerror
Source: "ssleay32.dll"; DestDir: "{app}"; Flags: regserver noregerror
;Source: "swiftshader\*"; DestDir: "{app}\swiftshader"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "chrome_100_percent.pak"; DestDir: "{app}"; Flags: ignoreversion
;Source: "chrome_200_percent.pak"; DestDir: "{app}"; Flags:ignoreversion
;Source: "cpas-WorkPlatform.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "d3dcompiler_47.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "ffmpeg.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "icudtl.dat"; DestDir: "{app}"; Flags: ignoreversion
;Source: "libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "libGLESv2.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "LICENSE.electron.txt"; DestDir: "{app}"; Flags: ignoreversion
;Source: "LICENSES.chromium.html"; DestDir: "{app}"; Flags: ignoreversion
;Source: "resources.pak"; DestDir: "{app}"; Flags: ignoreversion
;Source: "snapshot_blob.bin"; DestDir: "{app}"; Flags: ignoreversion
;Source: "start-日志.bat"; DestDir: "{app}"; Flags: ignoreversion
;Source: "v8_context_snapshot.bin"; DestDir: "{app}"; Flags: ignoreversion
;Source: "vk_swiftshader.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "vk_swiftshader_icd.json"; DestDir: "{app}"; Flags: ignoreversion
;创建空目录
[Dirs]
[Run]
Filename: "msiexec";StatusMsg: "正在卸载cpas-report-office-addin.msi加载项"; Parameters: "/x ""{app}\Tools\cpas-report-office-addin.msi"" /qn /lv ""{app}\Tools\cpas-report-office-addin卸载日志.log"""; WorkingDir: "{app}";
;Filename: "msiexec";StatusMsg: "正在安装UFCPAS6加载项"; Parameters: "/i ""{app}\Tools\cpas-report-office-addin.msi"" IACCEPTSQLNCLILICENSETERMS=YES /passive /lv ""{app}\Tools\cpas-report-office-addin安装日志.log"""; WorkingDir: "{app}"; Flags:runhidden;
Filename: "msiexec";StatusMsg: "正在安装UFCPAS6.1加载项"; Parameters: "/i ""{app}\Tools\cpasReport.msi"" IACCEPTSQLNCLILICENSETERMS=YES /passive /lv ""{app}\Tools\cpas-report-office-addin6-cpasReport安装日志.log"""; WorkingDir: "{app}"; Flags:runhidden;
;双重注册 ;注册Office加载项,[file]段也加入bat文件注册双保险
;Filename: "{app}\UFCPAS4Office\32位Office请执行我.bat"; Parameters: "notpause"; WorkingDir: "{app}\UFCPAS4Office"; Flags:runhidden nowait runasoriginaluser 32bit; Check: not IsOffice64;
;Filename: "{app}\UFCPAS4Office\64位Office请执行我.bat"; Parameters: "notpause"; WorkingDir: "{app}\UFCPAS4Office"; Flags:runhidden nowait runasoriginaluser 64bit; Check: IsOffice64;
;Filename: "{app}\UFCPAS4Office\注册Office加载项6.exe" ; Parameters: "-s"; WorkingDir: "{app}\UFCPAS4Office";
;Filename: "msiexec";StatusMsg: "正在安装UFCPAS6加载项"; Parameters: "/i ""{app}\Tools\cpas-report-office-addin.msi"" IACCEPTSQLNCLILICENSETERMS=YES /passive /lv ""{app}\Tools\cpas-report-office-addin安装日志.log"""; WorkingDir: "{app}"; Flags:runhidden;
Filename: "{app}\VSTO\RegeditVSTO.exe" ; Parameters: ""; WorkingDir: "{app}\VSTO";
[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
[Code]
function KillExe(Exename: PChar):integer; external 'KillExe@files:UFCPASSetupDll.dll stdcall setuponly';
function ProcessIsRun(Exename: PChar):boolean; external 'ProcessIsRun@files:UFCPASSetupDll.dll stdcall setuponly';
function GetExcelIsWin64(): Boolean; external 'GetExcelIsWin64@files:UFCPASSetupDll.dll stdcall setuponly';
procedure ClearTargetDir(TargetDir: string);
begin
Log('清空目录判断逻辑执行: ' + TargetDir)
if DirExists(TargetDir) then
begin
// 删除所有文件和子目录
if DelTree(TargetDir, True, True, True) then
Log('成功清空目录: ' + TargetDir)
else
Log('清空目录失败: ' + TargetDir);
end;
end;
var
LocalIsOffice64 :boolean;
//换个函数,直接使用GetExcelIsWin64函数,会报can't call proc
function IsOffice64(): boolean;
begin
//不能使用方法,直接不行 result := LocalIsOffice64
if LocalIsOffice64 then
result := true
else
result := false;
end;
function GetDefaultDir(Param: String): String;
var
OldPath,NewDrive:String;
C_FreeMB, C_TotalMB,T_FreeMB:Cardinal;
i:integer;
begin
if RegQueryStringValue(HKEY_USERS, '.default\software\'+ExpandConstant('{#MyAppRegName6}'),'Path', OldPath) then
begin //如果安装过,覆盖安装
Result := OldPath;
end else
begin
T_FreeMB:=0; NewDrive:='C:\';
C_FreeMB:=0; C_TotalMB:=0;
for i:=67 to 77 do //c:~K:\ 哪个盘空间大,就默认选择哪个盘
begin
GetSpaceOnDisk(Chr(i)+':\', True, C_FreeMB, C_TotalMB);
if C_FreeMB>T_FreeMB then
begin
T_FreeMB:=C_FreeMB;
NewDrive:=Chr(i)+':\';
end;
end;
result:=NewDrive+ExpandConstant('{#MyAppEnName6}');
end;
end;
function HasInstallOld():boolean;
var
aExeName:string ;
begin
result:= false;
aExeName := GetDefaultDir('')+'\'+ExpandConstant('{#MyAppExeName6}') ;
result:=FileExists(aExeName) ;
if not result then
MsgBox('不能安装更新,本机未安装审计软件。',mbInformation, MB_OK);
end;
function InitializeSetup (): Boolean;
begin
LocalIsOffice64 := GetExcelIsWin64();
result:=HasInstallOld();
end;
function GetSQLClientIsInstall():boolean;
begin
result:= RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Classes\CLSID\{8F4A6B68-4F36-4e3c-BE81-BC7CA4E9C45C}\ProgID');
end;
//默认安装路径
procedure CurPageChanged ( CurPageID : Integer);
begin
end;
//安装完成时
procedure CurStepChanged(CurStep: TSetupStep);//设置日期格式,生效,日期格式是在 [Registry] 段设置的
var ResultCode:integer;
workdir:string;
begin
if CurStep = ssPostInstall then
begin
PostMessage (HWND_BROADCAST,$001A, 0,0);//$001A=WM_SETTINGCHANGE SendMessage hui si ji
end
else
if CurStep=ssInstall then
begin
Exec('net', ExpandConstant('stop {#SQL_INSTANCE}'), '', SW_Hide,ewWaitUntilTerminated, ResultCode)
DelTree(ExpandConstant('{app}\AppData\Files\询证函模板'), False, True, True); //询证函模板 需清楚旧模板
end else
if CurStep=ssDone then
begin //暂时不行,找不到bpl
workdir := ExpandConstant('{app}\SysBpl');
ShellExec('',ExpandConstant('{app}\{#MyAppExeName6}'),'',workdir, SW_Show,ewNoWait, ResultCode)
end;
end;
//非法字符可能引起SQLServer语句出现问题 add by csb 2017-10-30
function ExistsInvalidChar(str:string):boolean;
begin
result := (pos('''', str) >0 )
or (pos('!', str) >0 )
or (pos('*', str) >0 )
or (pos('?', str) >0 )
or (pos('"', str) >0 )
or (pos('<', str) >0 )
or (pos('>', str) >0 ) ;
end;
function NextButtonClick ( CurPageID : Integer): Boolean;
var
aProcessIsRun:boolean;
begin
//MsgBox(IntToStr(CurPageID), mbInformation, MB_OK);
if (CurPageID = wpSelectDir) then//选择路径的界面,点击下一步时执行 add by csb 2017-10-30
begin
//MsgBox('1',mbInformation, MB_OK);
result :=not ExistsInvalidChar(ExpandConstant('{app}'));
if not result then
MsgBox('文件夹名不能包含下列任何字符:'+#13#10+#13#10+'/ : * ? " < > | '' ! ', mbCriticalError, MB_OK);
end
else if CurPageID = wpWelcome then
begin
result := true;
aProcessIsRun := ProcessIsRun('{#MyAppExeName6}') or ProcessIsRun('UFCPAS4.exe') or ProcessIsRun('CpasCloudSvr.exe')
or ProcessIsRun('ProjectManager.exe') ;
if aProcessIsRun then
begin
result := ( MsgBox('必须关闭正在运行的审计软件才能继续,是否关闭正在运行的软件?', mbConfirmation, MB_YESNO) = IDYES );
if result then
begin
KillExe('{#MyAppExeName6}');
KillExe('UFCPAS4.exe');
KillExe('ProjectManager.exe');
KillExe('CpasCloudSvr.exe');
end
end;
end
else begin
//MsgBox('3',mbInformation, MB_OK);
result := true;
end;
; 脚本由 Inno Setup 脚本向导 生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!
#include AddBackslash( CompilerPath ) + "ISPPBUILTINS.ISS"
#define MyAppName "审计软件升级程序"
; MyAppRegName 名称应保持与Config.ini中APPRegName配置一致,否则注册表读写不对应。
#define MyAppRegName4 "UFCPAS4"
#define MyAppExeName4 "UFCPAS4.exe"
#define MyAppRegName6 "CPAS6"
#define MyAppEnName6 "CPAS6"
#define MyAppExeName6 "cpas-WorkPlatform.exe"
#define MyAppVersion "6.0.250306"
#define MyAppPublisher "北京友数聚科技有限公司"
#define MyAppURL "http://www.youdatasum.com/"
#define SQL_Path "C:\AudSQL2014"
#define SQL_INSTANCE "MSSQL$AudSQL2014"
#define SQL_ServerName "(local)\AudSQL2014"
#define CurDateString GetDateTimeString('yyMMdd', '-', ':');
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{UFAUD001-498E-44A3-BFE8-FBC48803XAuto}
AppName={#MyAppName}
AppVersion=6.0.{#CurDateString}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
DefaultDirName={code:GetDefaultDir}
;D:\{#MyAppEnName}
DefaultGroupName={#MyAppName}
CreateAppDir=true
;OutputBaseFilename={#MyAppName}Setup-{#CurDateString}
OutputBaseFilename=AutoUpdate
OutputDir=E:\CPAS6-101 UFCPAS6.0 致同智审IAS版_测试版\AutoUpdate\
;lzma 压缩方式 lzma2/fast none
compression=lzma
;是否使用原来的安装路径,不让选择
UsePreviousAppDir=no
DisableDirPage=yes
SolidCompression=yes
Uninstallable=no
DisableReadyPage=yes
EnableDirDoesntExistWarning=no
DirExistsWarning=no
AlwaysShowGroupOnReadyPage=yes
DisableProgramGroupPage=yes
[Files]
;6.0项目管理工具与审计作业平台未分成两个EXE;
Source: "{#MyAppExeName6}"; DestDir: "{app}"; Flags: ignoreversion;
Source: "{#MyAppExeName4}"; DestDir: "{app}"; Flags: ignoreversion;
Source: "AutoUpdate\update.inf"; DestDir: "{app}\AutoUpdate";
;Source: "ConfigTool.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "CpasCloudSvr\CpasCloudSvr.exe"; DestDir: "{app}\CpasCloudSvr"; Flags: ignoreversion;
Source: "CpasCloudSvr\data\*"; DestDir: "{app}\CpasCloudSvr\data"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "AutoUpdateClient.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "1,68-A8-6D-14-57-9E.CPA"; DestDir: "{app}"; Flags: ignoreversion
;Source: "WorkPaperViewer.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "RegWorkPaperViewer.bat"; DestDir: "{app}"; Flags: ignoreversion
;Source: "CPAProjectSynchron.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "UFHSPSystem.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "FTPClient.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "CPASProtocol.exe"; DestDir: "{app}"; Flags: ignoreversion;
;Source: "borlndmm.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "UFCPASSetupDll.dll"; DestDir: "{app}\"; Flags: ignoreversion dontcopy
Source: "重启资源管理器.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "AppBPL\*"; DestDir: "{app}\AppBPL"; Flags: ignoreversion recursesubdirs createallsubdirs ;
Source: "Config\Config.ini"; DestDir: "{app}\Config"; Flags: ignoreversion
Source: "Config\Config.xml"; DestDir: "{app}\Config"; Flags: ignoreversion
Source: "Config\ExportExcel.xml"; DestDir: "{app}\Config"; Flags: ignoreversion
;Source: "Config\ServerConfig.ini"; DestDir: "{app}\Config"; Flags: ignoreversion
;Source: "Config\Symbol.ini"; DestDir: "{app}\Config"; Flags: ignoreversion
;Source: "Config\*"; DestDir: "{app}\Config"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "Data\*"; DestDir: "{app}\Data"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "SysBPL\*"; DestDir: "{app}\SysBPL"; Flags: ignoreversion recursesubdirs createallsubdirs
; 不能添加 Source: "SourceData\*"; DestDir: "{app}\SourceData"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "数据采集工具\*"; DestDir: "{app}\数据采集工具"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "演示数据\*"; DestDir: "{app}\演示数据"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "AppData\*"; DestDir: "{app}\AppData"; Flags: ignoreversion recursesubdirs createallsubdirs
;ProjectData文件夹内有演示企业的底稿文件,数据库初始化工具不能回复,暂时直接恢复;
;Source: "ProjectData\*"; DestDir: "{app}\ProjectData"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "DataConvert\*"; DestDir: "{app}\DataConvert"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "DBUpdate\*"; DestDir: "{app}\DBUpdate"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "升级包数据库升级脚本\*"; DestDir: "{app}\DBUpdate\Script\"; Flags: ignoreversion recursesubdirs createallsubdirs
;注册Office加载项,[run]段也加入bat文件注册双保险
;Source: "DataConvert\Dts_dll\dtspkg.dll"; DestDir: "{app}\DataConvert\Dts_dll"; DestName: "dtspkg.dll"; Flags: regserver noregerror;
;Source: "DataConvert\Dts_dll\dtspump.dll"; DestDir: "{app}\DataConvert\Dts_dll"; DestName: "dtspump.dll"; Flags: regserver noregerror;
;Office加载项换成新方式
Source: "VSTO\*"; DestDir: "{app}\VSTO"; Flags: ignoreversion recursesubdirs createallsubdirs;
Source: "UFCPAS4Office\UFSY4Protocol.exe"; DestDir: "{app}\UFCPAS4Office"; Flags: ignoreversion recursesubdirs createallsubdirs;BeforeInstall: ClearTargetDir(ExpandConstant('{app}\UFCPAS4Office'))
;注册Office加载项,[run]段也加入bat文件注册双保险
;Source: "UFCPAS4Office\libeay32.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "libeay32.dll"; Flags: regserver noregerror;
;Source: "UFCPAS4Office\ssleay32.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "ssleay32.dll"; Flags: regserver noregerror;
;注册Office加载项,[run]段也加入bat文件注册双保险
;Source: "UFCPAS4Office\UFCPAS4Office-32.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFCPAS4Office.dll"; Flags: regserver noregerror; Check: not IsOffice64
;Source: "UFCPAS4Office\UFCPAS4Office-64.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFCPAS4Office.dll"; Flags: regserver noregerror; Check: IsOffice64
;注册UFSYA.ocx,[run]段也加入bat文件注册双保险
;Source: "UFCPAS4Office\UFSYA-32.ocx"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFSYA-32.ocx"; Flags: regserver noregerror 32bit;
;Source: "UFCPAS4Office\UFSYA-64.ocx"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFSYA-64.ocx"; Flags: regserver noregerror 64bit; Check: IsWin64
;Source: "UFCPAS4Office\UFCPAS4Office-32.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFCPAS4Office-32.dll"; Flags: regserver noregerror 32bit;
;Source: "UFCPAS4Office\UFCPAS4Office-64.dll"; DestDir: "{app}\UFCPAS4Office"; DestName: "UFCPAS4Office-64.dll"; Flags: regserver noregerror 64bit; Check: IsWin64
Source: "Tools\cpas-office-tools.exe"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\cpas-report-office-addin.msi"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\cpasReport.msi"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\TBAnalyisi.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\template.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\DateSet.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\dg.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\dgfj.db"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Tools\BatchRefresh\Cpas6DgBatchRefresh.exe"; DestDir: "{app}\Tools\BatchRefresh"; Flags: ignoreversion recursesubdirs createallsubdirs
;UFCPAS6.0新增
;Source: "AppData\Files\报告模板\*"; DestDir: "{app}\AppData\Files\报告模板\"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "AppData\Files\底稿模板\*"; DestDir: "{app}\AppData\Files\底稿模板\"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "Tools\cpas-office-tools.exe"; DestDir: "{app}\Tools"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "cpas-apps\*"; DestDir: "{app}\cpas-apps"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "cpas-apps\db-config.json"; DestDir: "{app}\cpas-apps"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "cpas-apps\app-config.json"; DestDir: "{app}\cpas-apps"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "cpas-apps\user-config.json"; DestDir: "{app}\cpas-apps"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "locales\zh-CN.pak"; DestDir: "{app}\locales"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "locales\en-US.pak"; DestDir: "{app}\locales"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "locales\zh-TW.pak"; DestDir: "{app}\locales"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "resources\*"; DestDir: "{app}\resources"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "libeay32.dll"; DestDir: "{app}"; Flags: regserver noregerror
Source: "ssleay32.dll"; DestDir: "{app}"; Flags: regserver noregerror
;Source: "swiftshader\*"; DestDir: "{app}\swiftshader"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "chrome_100_percent.pak"; DestDir: "{app}"; Flags: ignoreversion
;Source: "chrome_200_percent.pak"; DestDir: "{app}"; Flags:ignoreversion
;Source: "cpas-WorkPlatform.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "d3dcompiler_47.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "ffmpeg.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "icudtl.dat"; DestDir: "{app}"; Flags: ignoreversion
;Source: "libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "libGLESv2.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "LICENSE.electron.txt"; DestDir: "{app}"; Flags: ignoreversion
;Source: "LICENSES.chromium.html"; DestDir: "{app}"; Flags: ignoreversion
;Source: "resources.pak"; DestDir: "{app}"; Flags: ignoreversion
;Source: "snapshot_blob.bin"; DestDir: "{app}"; Flags: ignoreversion
;Source: "start-日志.bat"; DestDir: "{app}"; Flags: ignoreversion
;Source: "v8_context_snapshot.bin"; DestDir: "{app}"; Flags: ignoreversion
;Source: "vk_swiftshader.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "vk_swiftshader_icd.json"; DestDir: "{app}"; Flags: ignoreversion
;创建空目录
[Dirs]
[Run]
Filename: "msiexec";StatusMsg: "正在卸载cpas-report-office-addin.msi加载项"; Parameters: "/x ""{app}\Tools\cpas-report-office-addin.msi"" /qn /lv ""{app}\Tools\cpas-report-office-addin卸载日志.log"""; WorkingDir: "{app}";
;Filename: "msiexec";StatusMsg: "正在安装UFCPAS6加载项"; Parameters: "/i ""{app}\Tools\cpas-report-office-addin.msi"" IACCEPTSQLNCLILICENSETERMS=YES /passive /lv ""{app}\Tools\cpas-report-office-addin安装日志.log"""; WorkingDir: "{app}"; Flags:runhidden;
Filename: "msiexec";StatusMsg: "正在安装UFCPAS6.1加载项"; Parameters: "/i ""{app}\Tools\cpasReport.msi"" IACCEPTSQLNCLILICENSETERMS=YES /passive /lv ""{app}\Tools\cpas-report-office-addin6-cpasReport安装日志.log"""; WorkingDir: "{app}"; Flags:runhidden;
;双重注册 ;注册Office加载项,[file]段也加入bat文件注册双保险
;Filename: "{app}\UFCPAS4Office\32位Office请执行我.bat"; Parameters: "notpause"; WorkingDir: "{app}\UFCPAS4Office"; Flags:runhidden nowait runasoriginaluser 32bit; Check: not IsOffice64;
;Filename: "{app}\UFCPAS4Office\64位Office请执行我.bat"; Parameters: "notpause"; WorkingDir: "{app}\UFCPAS4Office"; Flags:runhidden nowait runasoriginaluser 64bit; Check: IsOffice64;
;Filename: "{app}\UFCPAS4Office\注册Office加载项6.exe" ; Parameters: "-s"; WorkingDir: "{app}\UFCPAS4Office";
;Filename: "msiexec";StatusMsg: "正在安装UFCPAS6加载项"; Parameters: "/i ""{app}\Tools\cpas-report-office-addin.msi"" IACCEPTSQLNCLILICENSETERMS=YES /passive /lv ""{app}\Tools\cpas-report-office-addin安装日志.log"""; WorkingDir: "{app}"; Flags:runhidden;
Filename: "{app}\VSTO\RegeditVSTO.exe" ; Parameters: ""; WorkingDir: "{app}\VSTO";
[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
[Code]
function KillExe(Exename: PChar):integer; external 'KillExe@files:UFCPASSetupDll.dll stdcall setuponly';
function ProcessIsRun(Exename: PChar):boolean; external 'ProcessIsRun@files:UFCPASSetupDll.dll stdcall setuponly';
function GetExcelIsWin64(): Boolean; external 'GetExcelIsWin64@files:UFCPASSetupDll.dll stdcall setuponly';
procedure ClearTargetDir(TargetDir: string);
begin
Log('清空目录判断逻辑执行: ' + TargetDir)
if DirExists(TargetDir) then
begin
// 删除所有文件和子目录
if DelTree(TargetDir, True, True, True) then
Log('成功清空目录: ' + TargetDir)
else
Log('清空目录失败: ' + TargetDir);
end;
end;
var
LocalIsOffice64 :boolean;
//换个函数,直接使用GetExcelIsWin64函数,会报can't call proc
function IsOffice64(): boolean;
begin
//不能使用方法,直接不行 result := LocalIsOffice64
if LocalIsOffice64 then
result := true
else
result := false;
end;
function GetDefaultDir(Param: String): String;
var
OldPath,NewDrive:String;
C_FreeMB, C_TotalMB,T_FreeMB:Cardinal;
i:integer;
begin
if RegQueryStringValue(HKEY_USERS, '.default\software\'+ExpandConstant('{#MyAppRegName6}'),'Path', OldPath) then
begin //如果安装过,覆盖安装
Result := OldPath;
end else
begin
T_FreeMB:=0; NewDrive:='C:\';
C_FreeMB:=0; C_TotalMB:=0;
for i:=67 to 77 do //c:~K:\ 哪个盘空间大,就默认选择哪个盘
begin
GetSpaceOnDisk(Chr(i)+':\', True, C_FreeMB, C_TotalMB);
if C_FreeMB>T_FreeMB then
begin
T_FreeMB:=C_FreeMB;
NewDrive:=Chr(i)+':\';
end;
end;
result:=NewDrive+ExpandConstant('{#MyAppEnName6}');
end;
end;
function HasInstallOld():boolean;
var
aExeName:string ;
begin
result:= false;
aExeName := GetDefaultDir('')+'\'+ExpandConstant('{#MyAppExeName6}') ;
result:=FileExists(aExeName) ;
if not result then
MsgBox('不能安装更新,本机未安装审计软件。',mbInformation, MB_OK);
end;
function InitializeSetup (): Boolean;
begin
LocalIsOffice64 := GetExcelIsWin64();
result:=HasInstallOld();
end;
function GetSQLClientIsInstall():boolean;
begin
result:= RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Classes\CLSID\{8F4A6B68-4F36-4e3c-BE81-BC7CA4E9C45C}\ProgID');
end;
//默认安装路径
procedure CurPageChanged ( CurPageID : Integer);
begin
end;
//安装完成时
procedure CurStepChanged(CurStep: TSetupStep);//设置日期格式,生效,日期格式是在 [Registry] 段设置的
var ResultCode:integer;
workdir:string;
begin
if CurStep = ssPostInstall then
begin
PostMessage (HWND_BROADCAST,$001A, 0,0);//$001A=WM_SETTINGCHANGE SendMessage hui si ji
end
else
if CurStep=ssInstall then
begin
Exec('net', ExpandConstant('stop {#SQL_INSTANCE}'), '', SW_Hide,ewWaitUntilTerminated, ResultCode)
DelTree(ExpandConstant('{app}\AppData\Files\询证函模板'), False, True, True); //询证函模板 需清楚旧模板
end else
if CurStep=ssDone then
begin //暂时不行,找不到bpl
workdir := ExpandConstant('{app}\SysBpl');
ShellExec('',ExpandConstant('{app}\{#MyAppExeName6}'),'',workdir, SW_Show,ewNoWait, ResultCode)
end;
end;
//非法字符可能引起SQLServer语句出现问题 add by csb 2017-10-30
function ExistsInvalidChar(str:string):boolean;
begin
result := (pos('''', str) >0 )
or (pos('!', str) >0 )
or (pos('*', str) >0 )
or (pos('?', str) >0 )
or (pos('"', str) >0 )
or (pos('<', str) >0 )
or (pos('>', str) >0 ) ;
end;
function NextButtonClick ( CurPageID : Integer): Boolean;
var
aProcessIsRun:boolean;
begin
//MsgBox(IntToStr(CurPageID), mbInformation, MB_OK);
if (CurPageID = wpSelectDir) then//选择路径的界面,点击下一步时执行 add by csb 2017-10-30
begin
//MsgBox('1',mbInformation, MB_OK);
result :=not ExistsInvalidChar(ExpandConstant('{app}'));
if not result then
MsgBox('文件夹名不能包含下列任何字符:'+#13#10+#13#10+'/ : * ? " < > | '' ! ', mbCriticalError, MB_OK);
end
else if CurPageID = wpWelcome then
begin
result := true;
aProcessIsRun := ProcessIsRun('{#MyAppExeName6}') or ProcessIsRun('UFCPAS4.exe') or ProcessIsRun('CpasCloudSvr.exe')
or ProcessIsRun('ProjectManager.exe') ;
if aProcessIsRun then
begin
result := ( MsgBox('必须关闭正在运行的审计软件才能继续,是否关闭正在运行的软件?', mbConfirmation, MB_YESNO) = IDYES );
if result then
begin
KillExe('{#MyAppExeName6}');
KillExe('UFCPAS4.exe');
KillExe('ProjectManager.exe');
KillExe('CpasCloudSvr.exe');
end
end;
end
else begin
//MsgBox('3',mbInformation, MB_OK);
result := true;
end;
end;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment