From 0196a69a104f12d41c8135b4ebd8068c72c58a7e Mon Sep 17 00:00:00 2001 From: yuejiajun <1530620364@qq.com> Date: Mon, 18 Aug 2025 13:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=A8=A1=E5=9E=8B=E3=80=91=20?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/model/install-win7-model.iss | 48 ++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/server/model/install-win7-model.iss b/server/model/install-win7-model.iss index e1e9caf..ac46517 100644 --- a/server/model/install-win7-model.iss +++ b/server/model/install-win7-model.iss @@ -10,19 +10,23 @@ #define MyAppAssocName MyAppName + " File" #define MyAppAssocExt ".myp" #define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt +#define MyAppFirstPath "XManage" +#define MyAppResources "Resources" +#define InstallPassword GetDateTimeString('yyyymmdd', '', '') + ; 默认配置 [Setup] AppId={{A0EBDCA7-8C1A-43FD-BD3A-7E9E6D8B7F6C} ; 默认安装路径 -DefaultDirName={localappdata}\XManage +DefaultDirName={localappdata}\{#MyAppFirstPath} ; 安装密码 -Password=20250813 +Password={#InstallPassword} ; 是否加密 Encryption=yes ; ICO图标 -;SetupIconFile=Resources\icon.ico +;SetupIconFile={#MyAppResources}\icon.ico VersionInfoProductVersion=1.0.0 VersionInfoCompany= VersionInfoDescription={#MyAppName}服务 @@ -53,17 +57,20 @@ UninstallFilesDir={app}\{#MyAppExeName} UninstallDisplayIcon={app}\{#MyAppExeName}\{#MyAppExeName}.bat + ; 语言选择 [Languages] Name: "Chinese"; MessagesFile: "compiler:Languages\Chinese.isl" + ;; 任务 [Tasks] ; 是否创建桌面图标 Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + ;; 程序 ICO [Icons] ;Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}.exe" @@ -71,6 +78,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}\{#MyAppExeName}.bat"; Tasks: desktopicon + ;; 组件安装方式 [Types] ; 完整安装所有组件 @@ -80,6 +88,7 @@ Name: "mini"; Description: "最小安装"; Name: custom; Description: 自定义安装; Flags: iscustom + ;; 组件列表选择项 [Components] Name: Starter; Description: {#MyAppName} 启动; Types: full; @@ -88,24 +97,26 @@ Name: Server; Description: {#MyAppName} Server; Types: full mini; Name: Data; Description: {#MyAppName} Data; Types: full; + ;; 安装包引入文件列表 [Files] ; 后端工程+启动器 -;Source: "Resources\{#MyAppExeName}.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter -;Source: "Resources\{#MyAppExeName}-console.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter -;Source: "Resources\{#MyAppExeName}-x64.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter -;Source: "Resources\{#MyAppExeName}-x86.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter -;Source: "Resources\patch.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter +;Source: "{#MyAppResources}\{#MyAppExeName}.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter +;Source: "{#MyAppResources}\{#MyAppExeName}-console.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter +;Source: "{#MyAppResources}\{#MyAppExeName}-x64.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter +;Source: "{#MyAppResources}\{#MyAppExeName}-x86.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter +;Source: "{#MyAppResources}\patch.exe"; DestDir: "{app}\{#MyAppExeName}"; Flags: ignoreversion; Components: Starter -Source: "Resources\{#MyAppExeName}.bat"; DestDir: "{app}\{#MyAppExeName}"; DestName: "{#MyAppExeName}.bat"; Flags: ignoreversion; Components: Starter -Source: "Resources\server\demo-0.0.1.jar"; DestDir: "{app}\{#MyAppExeName}\bin"; Flags: ignoreversion; Components: Server +Source: "{#MyAppResources}\{#MyAppExeName}.bat"; DestDir: "{app}\{#MyAppExeName}"; DestName: "{#MyAppExeName}.bat"; Flags: ignoreversion; Components: Starter +Source: "{#MyAppResources}\server\demo-0.0.1.jar"; DestDir: "{app}\{#MyAppExeName}\bin"; Flags: ignoreversion; Components: Server ; 更新数据库脚本 -Source: "Resources\script\*"; DestDir: "{app}\{#MyAppExeName}\script"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Data +Source: "{#MyAppResources}\script\*"; DestDir: "{app}\{#MyAppExeName}\script"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Data ; 前端工程 + Nginx -Source: "Resources\web\*"; DestDir: "{app}\{#MyAppExeName}\web"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Starter; -Source: "Resources\dist\*"; DestDir: "{app}\{#MyAppExeName}\web\dist"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: UI; +Source: "{#MyAppResources}\web\*"; DestDir: "{app}\{#MyAppExeName}\web"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Starter; +Source: "{#MyAppResources}\dist\*"; DestDir: "{app}\{#MyAppExeName}\web\dist"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: UI; + ;; 创建必要目录 @@ -114,6 +125,7 @@ Name: "{app}\{#MyAppExeName}\web\logs"; Permissions: users-modify; Components: S Name: "{app}\{#MyAppExeName}\web\temp"; Permissions: users-modify; Components: Starter; + ;; 安装时注册表与环境变量列表 [Registry] Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; Flags: uninsdeletevalue; \ @@ -153,7 +165,15 @@ const // 定义 VC++ 2019 运行时的注册表检查路径 VC2019_REDIST_X64 = '{FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}'; VC2019_REDIST_X86 = '{422B21A3-06FA-3F2F-A6C6-21BCC9B8E2F3}'; - + + +// 获取安装密码 +function GetInstallPassword(): string; +begin + Result := GetDateTimeString('yyyymmdd', '', ''); +end; + + function SendMessageTimeout( hWnd: Integer; Msg: Integer;