359 lines
13 KiB
Plaintext
359 lines
13 KiB
Plaintext
; Script generated by the Inno Setup Script Wizard.
|
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
|
|
|
#define MyAppName "上华电缆敷设"
|
|
#define MyAppPublisher "ShangHuaSoft, Inc."
|
|
#define MyAppURL "http://www.shanghuasoft.com/"
|
|
#define MyAppExeName "ECR3D.exe"
|
|
#define DateTime GetDateTimeString('(yyyy.mm.dd-hh.nn)', '-', ':')
|
|
#define INIDateTime GetDateTimeString('yyyymmddhhnn', '', '')
|
|
|
|
#define PROFILES "SHS-ECR3D"
|
|
#define LOCK_VERSION "2025_V1_S0"
|
|
#define VERSION "2025"
|
|
#define PACKAGE_PATH "..\Original-File\ECableRoute3D"
|
|
#define APPDATA "\ShangHuaSoft\ECR3D-2025-V1.0"
|
|
#define APPVER "V1.0"
|
|
|
|
#define REG_KEY "Software\Autodesk\AutoCAD\R"
|
|
; 64bit 操作系统 安装了 R17平台的32bitCAD 用下面的key
|
|
#define REG_KEY2 "Software\WOW6432Node\Autodesk\AutoCAD\R"
|
|
|
|
[Setup]
|
|
AppId={{BD48A91D-518D-4C27-BA16-2C8679679FF9}
|
|
AppName={#MyAppName}
|
|
AppVersion={#APPVER}
|
|
AppPublisher={#MyAppPublisher}
|
|
AppPublisherURL={#MyAppURL}
|
|
AppSupportURL={#MyAppURL}
|
|
AppUpdatesURL={#MyAppURL}
|
|
DefaultDirName={sd}{#APPDATA}
|
|
DisableProgramGroupPage=yes
|
|
OutputDir=..\Output-File
|
|
OutputBaseFilename=ECR3DSetup{#VERSION}{#DateTime}
|
|
SetupIconFile={#PACKAGE_PATH}\sys\ECableRoute3d.ico
|
|
Compression=lzma
|
|
SolidCompression=yes
|
|
DisableDirPage=no
|
|
;Uninstallable=no
|
|
PrivilegesRequired=admin
|
|
ArchitecturesInstallIn64BitMode=x64
|
|
;修改左侧图片(大)
|
|
;WizardImageFile=dh.bmp
|
|
;修改右上角图片(小)
|
|
;WizardSmallImageFile=xx.bmp
|
|
|
|
|
|
[Languages]
|
|
Name: "Chinese"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
|
|
|
|
[Tasks]
|
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone
|
|
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
|
|
Name: "remote" ; Description:"集团授权";GroupDescription: "选择授权"; Flags: exclusive;
|
|
Name: "local" ; Description:"单机授权";GroupDescription: "选择授权"; Flags: exclusive
|
|
|
|
[Files]
|
|
Source: "{#PACKAGE_PATH}\StartUp.exe"; DestDir: "{app}\"; DestName: "{#MyAppExeName}"; Flags: ignoreversion
|
|
Source: "{#PACKAGE_PATH}\上华软件-集团服务器设置工具.exe"; DestDir: "{app}\"; Flags: ignoreversion;Tasks: remote
|
|
Source: "{#PACKAGE_PATH}\上华软件-授权管理工具.exe"; DestDir: "{app}\"; Flags: ignoreversion;Tasks: local
|
|
Source: "{#PACKAGE_PATH}\demo\*"; DestDir: "{app}\demo\"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
|
|
Source: "{#PACKAGE_PATH}\AsdkHlrDbx\*"; DestDir: "{app}\AsdkHlrDbx\"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
|
|
Source: "{#PACKAGE_PATH}\drawframe\*"; DestDir: "{app}\drawframe\"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
|
|
Source: "{#PACKAGE_PATH}\Support\*"; DestDir: "{app}\Support\"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
|
|
|
|
;sys目录下文件比较复杂,在此一一说明
|
|
;*.db文件为用户数据文件,不要求覆盖
|
|
;dict.xml文件专版用户需要使用,不要求覆盖
|
|
|
|
;拷贝所有sys内的文件,覆盖
|
|
Source: "{#PACKAGE_PATH}\sys\*"; DestDir: "{app}\sys\"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.db,dict.xml,shs-zw.cuix,shs-zw.dll,poolplant_zw.ico"
|
|
|
|
;单独处里以下类型文件,不覆盖原有文件
|
|
Source: "{#PACKAGE_PATH}\sys\*.db"; DestDir: "{app}\sys\"; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall; Excludes: "Plumbing.db,cityStandard.db"
|
|
;cityStandard.db,Plumbing.db文件要求覆盖
|
|
Source: "{#PACKAGE_PATH}\sys\cityStandard.db"; DestDir: "{app}\sys\"; Flags: ignoreversion recursesubdirs createallsubdirs
|
|
Source: "{#PACKAGE_PATH}\sys\Plumbing.db"; DestDir: "{app}\sys\"; Flags: ignoreversion recursesubdirs createallsubdirs
|
|
|
|
;arx文件
|
|
Source: "{#PACKAGE_PATH}\[v90][x64]\*"; DestDir: "{app}\sys18x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64
|
|
Source: "{#PACKAGE_PATH}\[v100][x64]\*"; DestDir: "{app}\sys19x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64
|
|
Source: "{#PACKAGE_PATH}\[v110][x64]\*"; DestDir: "{app}\sys20x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64
|
|
Source: "{#PACKAGE_PATH}\[v140][x64]\*"; DestDir: "{app}\sys21x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64
|
|
Source: "{#PACKAGE_PATH}\[v140R22][x64]\*"; DestDir: "{app}\sys22x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64
|
|
Source: "{#PACKAGE_PATH}\[v141][x64]\*"; DestDir: "{app}\sys23x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64
|
|
Source: "{#PACKAGE_PATH}\[v142][x64]\*"; DestDir: "{app}\sys24x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64
|
|
Source: "{#PACKAGE_PATH}\[v143][x64]\*"; DestDir: "{app}\sys25x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64
|
|
|
|
;arx加密文件
|
|
Source: "{#PACKAGE_PATH}\BAL_REMOTE\[v90][x64]\*"; DestDir: "{app}\sys18x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: remote
|
|
Source: "{#PACKAGE_PATH}\BAL_REMOTE\[v100][x64]\*"; DestDir: "{app}\sys19x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: remote
|
|
Source: "{#PACKAGE_PATH}\BAL_REMOTE\[v110][x64]\*"; DestDir: "{app}\sys20x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: remote
|
|
Source: "{#PACKAGE_PATH}\BAL_REMOTE\[v140][x64]\*"; DestDir: "{app}\sys21x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: remote
|
|
Source: "{#PACKAGE_PATH}\BAL_REMOTE\[v140R22][x64]\*"; DestDir: "{app}\sys22x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: remote
|
|
Source: "{#PACKAGE_PATH}\BAL_REMOTE\[v141][x64]\*"; DestDir: "{app}\sys23x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: remote
|
|
Source: "{#PACKAGE_PATH}\BAL_REMOTE\[v142][x64]\*"; DestDir: "{app}\sys24x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: remote
|
|
Source: "{#PACKAGE_PATH}\BAL_REMOTE\[v143][x64]\*"; DestDir: "{app}\sys25x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: remote
|
|
|
|
Source: "{#PACKAGE_PATH}\BAL_LOCAL\[v90][x64]\*"; DestDir: "{app}\sys18x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: local
|
|
Source: "{#PACKAGE_PATH}\BAL_LOCAL\[v100][x64]\*"; DestDir: "{app}\sys19x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: local
|
|
Source: "{#PACKAGE_PATH}\BAL_LOCAL\[v110][x64]\*"; DestDir: "{app}\sys20x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: local
|
|
Source: "{#PACKAGE_PATH}\BAL_LOCAL\[v140][x64]\*"; DestDir: "{app}\sys21x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: local
|
|
Source: "{#PACKAGE_PATH}\BAL_LOCAL\[v140R22][x64]\*"; DestDir: "{app}\sys22x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: local
|
|
Source: "{#PACKAGE_PATH}\BAL_LOCAL\[v141][x64]\*"; DestDir: "{app}\sys23x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: local
|
|
Source: "{#PACKAGE_PATH}\BAL_LOCAL\[v142][x64]\*"; DestDir: "{app}\sys24x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: local
|
|
Source: "{#PACKAGE_PATH}\BAL_LOCAL\[v143][x64]\*"; DestDir: "{app}\sys25x64\"; Flags: ignoreversion recursesubdirs createallsubdirs; Check: IsWin64; Tasks: local
|
|
|
|
[Registry]
|
|
Root: HKLM; Subkey: "Software\ShangHuaSoft\ECR3D_{#LOCK_VERSION}"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"; Flags: uninsdeletekey
|
|
|
|
[Icons]
|
|
Name: "{commonprograms}\{#MyAppName} {#APPVER}"; Filename: "{app}\{#MyAppExeName}"
|
|
Name: "{commondesktop}\{#MyAppName} {#APPVER}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
|
|
|
[Run]
|
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
|
|
|
[LangOptions]
|
|
LanguageID=$0804
|
|
|
|
[INI]
|
|
Filename: "{app}\sys\license.ini"; Section: "Product"; Key: "Mode"; String: "120";
|
|
Filename: "{app}\sys\product.ini"; Section: "Product"; Key: "BAL_MODE"; String: "REMOTE"; Tasks: remote
|
|
Filename: "{app}\sys\product.ini"; Section: "Product"; Key: "BAL_MODE"; String: "LOCAL"; Tasks: local
|
|
Filename: "{app}\sys\product.ini"; Section: "Product"; Key: "BAL_PRODUCT"; String: "";
|
|
Filename: "{app}\sys\product.ini"; Section: "Product"; Key: "SubVer"; String: Build{#INIDateTime};
|
|
Filename: "{app}\sys\product.ini"; Section: "Product"; Key: "ProfilesName"; String: {#PROFILES};
|
|
Filename: "{app}\sys\product.ini"; Section: "Product"; Key: "Version"; String: {#VERSION};
|
|
Filename: "{app}\sys\product.ini"; Section: "Product"; Key: "APPVer"; String: {#APPVER};
|
|
Filename: "{app}\sys\product.ini"; Section: "Product"; Key: "CADVer"; String: "18:25";
|
|
|
|
[Messages]
|
|
ButtonFinish=完成(&F)
|
|
|
|
[InstallDelete]
|
|
|
|
[code]
|
|
function hasCADVersion(ver:string):boolean;
|
|
var
|
|
s:string;
|
|
begin
|
|
s := '{#REG_KEY}' + ver + '\';
|
|
Log(s);
|
|
if RegKeyExists(HKCU, s) then
|
|
begin
|
|
Result := true;
|
|
Log('exists');
|
|
end
|
|
else
|
|
begin
|
|
Result := false;
|
|
Log('no exists');
|
|
end;
|
|
end;
|
|
|
|
function getRoamableRootFolder(ver:string; name:string):string;
|
|
var
|
|
key:string;
|
|
I: Integer;
|
|
S: String;
|
|
value:string;
|
|
begin
|
|
key := '{#REG_KEY}' + ver + '\' + name + '\';
|
|
Log(key);
|
|
if RegKeyExists(HKCU, key) then
|
|
begin
|
|
if RegValueExists(HKCU, key, 'RoamableRootFolder') then
|
|
begin
|
|
RegQueryStringValue(HKCU, key, 'RoamableRootFolder', value);
|
|
Result := value;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
function getDefaultACADContent(ver:string; name:string):string;
|
|
var
|
|
key:string;
|
|
Names: TArrayOfString;
|
|
I: Integer;
|
|
S: String;
|
|
acad:string;
|
|
insDir:string;
|
|
RoamableRoot:string;
|
|
begin
|
|
RoamableRoot := getRoamableRootFolder(ver,name);
|
|
Log(RoamableRoot);
|
|
|
|
if IsWin64 then
|
|
if (ver='17.0') or (ver='17.1') or (ver='17.2')then
|
|
key := '{#REG_KEY2}' + ver + '\' + name + '\'
|
|
else
|
|
key := '{#REG_KEY}' + ver + '\' + name + '\'
|
|
else
|
|
key := '{#REG_KEY}' + ver + '\' + name + '\';
|
|
|
|
Log(key);
|
|
if RegKeyExists(HKLM, key) then
|
|
begin
|
|
if RegValueExists(HKLM, key, 'AcadLocation') then
|
|
begin
|
|
RegQueryStringValue(HKLM, key, 'AcadLocation', insDir);
|
|
acad := insDir + '\SUPPORT;'
|
|
acad := acad + insDir + '\FONTS;'
|
|
acad := acad + insDir + '\HELP;'
|
|
acad := acad + insDir + '\SUPPORT\zh-cn;'
|
|
acad := acad + RoamableRoot + 'SUPPORT;'
|
|
Log(acad);
|
|
Result := acad;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
function setCADProfilesKey(verM:string; verS:string):boolean;
|
|
var
|
|
key:string;
|
|
subkey:string;
|
|
Names: TArrayOfString;
|
|
I: Integer;
|
|
S: String;
|
|
pfsKey: String;
|
|
ver:String;
|
|
sApp:String;
|
|
str1:String;
|
|
str2:String;
|
|
intM:Integer;
|
|
begin
|
|
ver := verM+'.'+verS;
|
|
sApp := ExpandConstant('{app}');
|
|
intM := StrToInt(verM);
|
|
|
|
if (hasCADVersion(ver)) then
|
|
begin
|
|
key := '{#REG_KEY}' + ver + '\';
|
|
Log(key);
|
|
if RegGetSubkeyNames(HKCU, key, Names) then
|
|
begin
|
|
S := '';
|
|
for I := 0 to GetArrayLength(Names)-1 do
|
|
begin
|
|
subkey := key + Names[I] + '\Profiles\';
|
|
Log(subkey);
|
|
if RegKeyExists(HKEY_CURRENT_USER, subkey) then
|
|
begin
|
|
pfsKey := subkey + '{#PROFILES}{#VERSION}' + '\Drawing Window';
|
|
RegWriteDWordValue(HKCU, pfsKey, 'Parallel background', $00e1e1e1);
|
|
RegWriteDWordValue(HKCU, pfsKey, 'Parallel grid minor lines color', $00d2d2d2);
|
|
RegWriteDWordValue(HKCU, pfsKey, 'Background', $00000000);
|
|
RegWriteDWordValue(HKCU, pfsKey, 'XhairPickboxEtc', $00ffffff);
|
|
pfsKey := subkey + '{#PROFILES}{#VERSION}' + '\General';
|
|
str1 := sApp + '\sys' + verM + 'x64;' + sApp + '\sys' + verM + ';' + sApp + '\sys;' + sApp + '\dwb;';
|
|
str2 := getDefaultACADContent(ver, Names[I]);
|
|
RegWriteStringValue(HKCU, pfsKey, 'ACAD', str1 + str2);
|
|
if intM > 18 then
|
|
begin
|
|
pfsKey := subkey + '{#PROFILES}{#VERSION}' + '\Variables';
|
|
RegWriteStringValue(HKCU, pfsKey, 'TRUSTEDPATHS', str1);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
procedure CurStepChanged(CurStep: TSetupStep);
|
|
begin
|
|
if CurStep=ssinstall then
|
|
begin
|
|
|
|
setCADProfilesKey('18','0');
|
|
setCADProfilesKey('18','1');
|
|
setCADProfilesKey('18','2');
|
|
|
|
setCADProfilesKey('19','0');
|
|
setCADProfilesKey('19','1');
|
|
setCADProfilesKey('19','2');
|
|
|
|
setCADProfilesKey('20','0');
|
|
setCADProfilesKey('20','1');
|
|
|
|
setCADProfilesKey('21','0');
|
|
|
|
setCADProfilesKey('22','0');
|
|
|
|
setCADProfilesKey('23','0');
|
|
setCADProfilesKey('23','1');
|
|
|
|
setCADProfilesKey('24','0');
|
|
setCADProfilesKey('24','1');
|
|
setCADProfilesKey('24','2');
|
|
setCADProfilesKey('24','3');
|
|
|
|
setCADProfilesKey('25','0');
|
|
end;
|
|
if CurStep=ssPostinstall then
|
|
begin
|
|
|
|
end;
|
|
if CurStep=ssDone then
|
|
end;
|
|
|
|
function deleteKey(ver:string):boolean;
|
|
var
|
|
key:string;
|
|
subkey:string;
|
|
Names: TArrayOfString;
|
|
I: Integer;
|
|
S: String;
|
|
begin
|
|
if not hasCADVersion(ver) then
|
|
begin
|
|
Result := false;
|
|
exit;
|
|
end;
|
|
|
|
key := '{#REG_KEY}' + ver + '\';
|
|
Log(key);
|
|
if RegGetSubkeyNames(HKCU, key, Names) then
|
|
begin
|
|
S := '';
|
|
for I := 0 to GetArrayLength(Names)-1 do
|
|
begin
|
|
subkey := key + Names[I] + '\Profiles\' + '{#PROFILES}{#VERSION}';
|
|
Log(subkey);
|
|
if RegKeyExists(HKCU, subkey) then
|
|
RegDeleteKeyIncludingSubkeys(HKCU, subkey);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
|
var
|
|
key:string;
|
|
begin
|
|
// 把新建的注册表删除
|
|
|
|
deleteKey('18.0');
|
|
deleteKey('18.1');
|
|
deleteKey('18.2');
|
|
|
|
deleteKey('19.0');
|
|
deleteKey('19.1');
|
|
deleteKey('19.2');
|
|
|
|
deleteKey('20.0');
|
|
deleteKey('20.1');
|
|
|
|
deleteKey('21.0');
|
|
|
|
deleteKey('22.0');
|
|
|
|
deleteKey('23.0');
|
|
deleteKey('23.1');
|
|
|
|
deleteKey('24.0');
|
|
deleteKey('24.1');
|
|
deleteKey('24.2');
|
|
deleteKey('24.3');
|
|
|
|
deleteKey('25.0');
|
|
end; |