diff --git a/server/simulation/Resources/simulation.bat b/server/simulation/Resources/simulation.bat index 3e13e2c..9d19df4 100644 --- a/server/simulation/Resources/simulation.bat +++ b/server/simulation/Resources/simulation.bat @@ -2,12 +2,13 @@ chcp 65001 >nul title Simulation Quick Start +cd %SIMULATION_MAIN% if exist "%SIMULATION_MANAGE_BIN%" ( start "Simulation Server" cmd /k "chcp 65001 && title Simulation Server && java -Dspring.profiles.active=test,mysql,redis,rocketmq,springdoc %SIMULATION_VM_PARAMS% -jar %SIMULATION_MANAGE_BIN%" ) if exist "%SIMULATION_MANAGE_BIN%" ( - cd %SIMULATION_MAIN%\web + cd web start "Simulation Website" cmd /k "title Simulation Website && simulation-web.exe -c conf/web.conf" ) diff --git a/server/simulation/Resources/web/conf/simulation-windows.conf b/server/simulation/Resources/web/conf/simulation-windows.conf index d8c1618..093d57c 100644 --- a/server/simulation/Resources/web/conf/simulation-windows.conf +++ b/server/simulation/Resources/web/conf/simulation-windows.conf @@ -1,62 +1,62 @@ server { - listen 18280; - server_name _; - gzip on; - gzip_min_length 1k; - gzip_comp_level 9; - gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; - gzip_vary on; - gzip_disable "MSIE [1-6]\."; + listen 18280; + server_name _; + gzip on; + gzip_min_length 1k; + gzip_comp_level 9; + gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; + gzip_vary on; + gzip_disable "MSIE [1-6]\."; - root dist; - include mime.types; + root dist; + include mime.types; - location / { - try_files $uri $uri/ /index.html; - } - - # location /login { - # proxy_pass http://127.0.0.1:28280/login; - # proxy_set_header Host $host; - # proxy_set_header X-Real-IP $remote_addr; - # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # } - - location /api/ { - proxy_pass http://127.0.0.1:28280/; - client_max_body_size 100M; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location /dev-api/ { - proxy_pass http://127.0.0.1:28280/; - client_max_body_size 100M; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } + location / { + try_files $uri $uri/ /index.html; + } + + # location /login { + # proxy_pass http://127.0.0.1:28280/login; + # proxy_set_header Host $host; + # proxy_set_header X-Real-IP $remote_addr; + # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # } + + location /api/ { + proxy_pass http://127.0.0.1:28280/; + client_max_body_size 100M; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location /dev-api/ { + proxy_pass http://127.0.0.1:28280/; + client_max_body_size 100M; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } - location /file/ { - proxy_pass http://127.0.0.1:9000/; - client_max_body_size 5000M; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Real-IP $remote_addr; - error_page 405 =200 $request_uri; + location /file/ { + proxy_pass http://127.0.0.1:9000/; + client_max_body_size 5000M; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + error_page 405 =200 $request_uri; + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; + if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; } + } } diff --git a/server/simulation/install-win7-simulation.iss b/server/simulation/install-win7-simulation.iss index 9d2c650..6f59cc0 100644 --- a/server/simulation/install-win7-simulation.iss +++ b/server/simulation/install-win7-simulation.iss @@ -5,6 +5,8 @@ #define MyAppPublisher "X" #define MyAppURL "~" #define MyAppExeName "simulation" +#define MyAppExeNameHump "Simulation" +#define MyAppExeNameUpper "SIMULATION" #define MyAppAssocName MyAppName + " File" #define MyAppAssocExt ".myp" #define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt @@ -47,7 +49,7 @@ PrivilegesRequired=admin ArchitecturesAllowed=x64compatible ArchitecturesInstallIn64BitMode=x64compatible OutputDir=Release\ -OutputBaseFilename=SimulationSetup-{#MyAppVersion} +OutputBaseFilename={#MyAppExeNameHump}Setup-{#MyAppVersion} UninstallFilesDir={app}\{#MyAppExeName} UninstallDisplayIcon={app}\{#MyAppExeName}\{#MyAppExeName}.bat @@ -63,6 +65,13 @@ Name: "Chinese"; MessagesFile: "compiler:Languages\Chinese.isl" Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked +;; 程序 ICO +[Icons] +;Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}.exe" +;Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}.exe"; Tasks: desktopicon +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}\{#MyAppExeName}.bat"; Tasks: desktopicon + + ;; 组件安装方式 [Types] ; 完整安装所有组件 @@ -109,13 +118,13 @@ Name: "{app}\{#MyAppExeName}\web\temp"; Permissions: users-modify; Components: S ;; 安装时注册表与环境变量列表 [Registry] Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; Flags: uninsdeletevalue; \ - ValueName: "SIMULATION_MAIN"; ValueData: "{app}\{#MyAppExeName}"; + ValueName: "{#MyAppExeNameUpper}_MAIN"; ValueData: "{app}\{#MyAppExeName}"; ; 启动jar Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; Flags: uninsdeletevalue; \ - ValueName: "SIMULATION_MANAGE_BIN"; ValueData: "{app}\{#MyAppExeName}\bin\demo-0.0.1.jar"; + ValueName: "{#MyAppExeNameUpper}_MANAGE_BIN"; ValueData: "{app}\{#MyAppExeName}\bin\demo-0.0.1.jar"; ; 扩展启动vm变量 Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; Flags: uninsdeletevalue; \ - ValueName: "SIMULATION_VM_PARAMS"; ValueData: " \ + ValueName: "{#MyAppExeNameUpper}_VM_PARAMS"; ValueData: " \ --enable-preview \ -Dserver.port=28280 \ -Djasypt.encryptor.password=jwnwfA1pIoLihBptgbR8S6UEEAfGurjG \ @@ -129,13 +138,7 @@ Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environmen "; -;; 程序 ICO -[Icons] -;Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}.exe" -;Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}.exe"; Tasks: desktopicon -Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}\{#MyAppExeName}.bat"; Tasks: desktopicon - - + ;; 安装完运行的菜单与后续操作 ; [Run] ;; 安装完成后运行 startup.exe @@ -272,6 +275,6 @@ end; [UninstallRun] -Filename: "taskkill"; Parameters: "-f -im simulation-web.exe"; Flags: runascurrentuser runhidden waituntilterminated +Filename: "taskkill"; Parameters: "-f -im {#MyAppExeName}-web.exe"; Flags: runascurrentuser runhidden waituntilterminated