-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_installer.bat
More file actions
134 lines (114 loc) · 3.34 KB
/
create_installer.bat
File metadata and controls
134 lines (114 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
@echo off
chcp 65001 >nul
echo ========================================
echo Windows Update管理工具 - 安装程序制作
echo ========================================
echo.
echo 正在检查NSIS安装...
where makensis >nul 2>&1
if errorlevel 1 (
echo ❌ NSIS未安装或未添加到PATH
echo.
echo 请按以下步骤安装NSIS:
echo 1. 访问 https://nsis.sourceforge.io/Download
echo 2. 下载并安装NSIS
echo 3. 将NSIS安装目录添加到系统PATH环境变量
echo (通常是 C:\Program Files ^(x86^)\NSIS)
echo.
echo 或者使用便携版:
echo 1. 下载NSIS便携版
echo 2. 解压到任意目录
echo 3. 将makensis.exe路径添加到PATH
echo.
pause
exit /b 1
)
echo ✅ NSIS检查通过
echo.
echo 正在检查EXE文件...
if not exist "dist\WindowsUpdateManager\WindowsUpdateManager.exe" (
echo ❌ 未找到打包后的EXE文件
echo 请先运行 build_exe.bat 打包程序
pause
exit /b 1
)
echo ✅ EXE文件检查通过
echo.
echo 正在检查必需文件...
set "missing_files="
if not exist "LICENSE" (
echo ⚠️ 缺少LICENSE文件,正在创建...
echo MIT License > LICENSE
echo. >> LICENSE
echo Copyright ^(c^) 2024 Windows Update Manager Team >> LICENSE
echo. >> LICENSE
echo Permission is hereby granted, free of charge, to any person obtaining a copy >> LICENSE
echo of this software and associated documentation files ^(the "Software"^), to deal >> LICENSE
echo in the Software without restriction... >> LICENSE
)
if not exist "README.md" (
set "missing_files=%missing_files% README.md"
)
if not exist "USER_GUIDE.md" (
set "missing_files=%missing_files% USER_GUIDE.md"
)
if not "%missing_files%"=="" (
echo ⚠️ 缺少文件:%missing_files%
echo 将使用现有文件继续构建...
)
echo ✅ 文件检查完成
echo.
echo 正在创建安装程序...
echo 这可能需要几分钟时间,请耐心等待...
echo.
makensis installer_script.nsi
if errorlevel 1 (
echo ❌ 安装程序创建失败
echo 请检查NSIS脚本和文件路径
pause
exit /b 1
)
echo.
echo ✅ 安装程序创建完成!
echo.
echo 正在验证安装程序...
if exist "WindowsUpdateManager_Setup.exe" (
echo ✅ 安装程序文件存在
REM 获取文件大小
for %%A in ("WindowsUpdateManager_Setup.exe") do (
set "file_size=%%~zA"
)
echo 📊 安装程序信息:
echo 文件名:WindowsUpdateManager_Setup.exe
echo 大小:%file_size% 字节
REM 转换为MB
set /a "size_mb=%file_size% / 1048576"
echo 大小:约 %size_mb% MB
) else (
echo ❌ 安装程序文件不存在
pause
exit /b 1
)
echo.
echo ========================================
echo 🎉 安装程序制作完成!
echo ========================================
echo.
echo 安装程序文件:
echo WindowsUpdateManager_Setup.exe
echo.
echo 安装程序特性:
echo ✅ 需要管理员权限运行
echo ✅ 只能安装在系统盘(C盘)
echo ✅ 支持Windows 10/11系统
echo ✅ 包含完整的卸载程序
echo ✅ 可选择安装组件
echo ✅ 自动创建快捷方式
echo ✅ 支持开机自启动设置
echo.
echo 测试建议:
echo 1. 在虚拟机中测试安装程序
echo 2. 验证所有功能正常工作
echo 3. 测试卸载程序功能
echo.
pause