|
@@ -3,7 +3,7 @@
|
3
|
3
|
|
4
|
4
|
#define MyAppName "星火微课"
|
5
|
5
|
#define MyAppDir "xhwk"
|
6
|
|
-#define MyAppVersion "3.1.12"
|
|
6
|
+#define MyAppVersion "3.1.13"
|
7
|
7
|
#define MyAppPublisher "河南星火燎原软件科技有限公司"
|
8
|
8
|
#define MyAppURL "http://www.xhkjedu.com/"
|
9
|
9
|
#define MySourcePath "D:\Project\CSharp\xhwkclient\XHWK.WKTool\bin\x86\Debug\"
|
|
@@ -55,9 +55,9 @@ Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Fil
|
55
|
55
|
[Run]
|
56
|
56
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
57
|
57
|
|
58
|
|
-[Code]
|
|
58
|
+[Code]
|
59
|
59
|
// 自定义函数,判断软件是否运行,参数为需要判断的软件的exe名称
|
60
|
|
-function KDetectSoft(strExeName: String): Boolean;
|
|
60
|
+function CheckSoftRun(strExeName: String): Boolean;
|
61
|
61
|
// 变量定义
|
62
|
62
|
var ErrorCode: Integer;
|
63
|
63
|
var bRes: Boolean;
|
|
@@ -99,7 +99,7 @@ end;
|
99
|
99
|
function NextButtonClick(CurPageID: Integer): Boolean;
|
100
|
100
|
begin
|
101
|
101
|
if 1=CurPageID then begin
|
102
|
|
- Result := KDetectSoft('{#MyAppExeName}');
|
|
102
|
+ Result := CheckSoftRun('{#MyAppExeName}');
|
103
|
103
|
Exit;
|
104
|
104
|
end;
|
105
|
105
|
Result:= true;
|
|
@@ -108,33 +108,38 @@ end;
|
108
|
108
|
// 卸载时关闭软件
|
109
|
109
|
function InitializeUninstall(): Boolean;
|
110
|
110
|
begin
|
111
|
|
- Result := KDetectSoft('{#MyAppExeName}');
|
|
111
|
+ Result := CheckSoftRun('{#MyAppExeName}');
|
112
|
112
|
end;
|
113
|
113
|
|
114
|
|
-// Indicates whether the specified version and service pack of the .NET Framework is installed.
|
115
|
|
-//
|
116
|
|
-// version -- Specify one of these strings for the required .NET Framework version:
|
117
|
|
-// 'v1.1' .NET Framework 1.1
|
118
|
|
-// 'v2.0' .NET Framework 2.0
|
119
|
|
-// 'v3.0' .NET Framework 3.0
|
120
|
|
-// 'v3.5' .NET Framework 3.5
|
121
|
|
-// 'v4\Client' .NET Framework 4.0 Client Profile
|
122
|
|
-// 'v4\Full' .NET Framework 4.0 Full Installation
|
123
|
|
-// 'v4.5' .NET Framework 4.5
|
124
|
|
-// 'v4.5.1' .NET Framework 4.5.1
|
125
|
|
-// 'v4.5.2' .NET Framework 4.5.2
|
126
|
|
-// 'v4.6' .NET Framework 4.6
|
127
|
|
-// 'v4.6.1' .NET Framework 4.6.1
|
128
|
|
-// 'v4.6.2' .NET Framework 4.6.2
|
129
|
|
-// 'v4.7' .NET Framework 4.7
|
130
|
|
-// 'v4.7.1' .NET Framework 4.7.1
|
131
|
|
-// 'v4.7.2' .NET Framework 4.7.2
|
132
|
|
-// 'v4.8' .NET Framework 4.8
|
133
|
|
-//
|
134
|
|
-// service -- Specify any non-negative integer for the required service pack level:
|
135
|
|
-// 0 No service packs required
|
136
|
|
-// 1, 2, etc. Service pack 1, 2, etc. required
|
137
|
|
-function IsDotNetDetected(version: string; service: cardinal): boolean;
|
|
114
|
+function CheckVC():boolean;
|
|
115
|
+var Path:string;
|
|
116
|
+ ResultCode: Integer;
|
|
117
|
+begin
|
|
118
|
+ if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{01FAEC41-B3BC-44F4-B185-5E8475AEB855}', 'Version')
|
|
119
|
+ or RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{77EB1EA9-8E1B-459D-8CDC-1984D0FF15B6}', 'Version')
|
|
120
|
+ then
|
|
121
|
+ begin
|
|
122
|
+ Result := true;
|
|
123
|
+ end
|
|
124
|
+ else
|
|
125
|
+ begin
|
|
126
|
+ if MsgBox('系统检测到您没有安装VC++环境,是否立刻下载并安装?', mbConfirmation, MB_YESNO) = idYes then
|
|
127
|
+ begin
|
|
128
|
+ Path := ExpandConstant('{pf}/Internet Explorer/iexplore.exe');
|
|
129
|
+ Exec(Path, 'https://xhkjedu.oss-cn-huhehaote.aliyuncs.com/runtime/vc_redist.x86.exe', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
|
|
130
|
+ MsgBox('请安装好VC++环境后,再运行本安装包程序!',mbInformation,MB_OK);
|
|
131
|
+ Result := false;
|
|
132
|
+ end
|
|
133
|
+ else
|
|
134
|
+ begin
|
|
135
|
+ MsgBox('取消后请手动安装VC2015-2019环境!',mbInformation,MB_OK);
|
|
136
|
+ Result := true;
|
|
137
|
+ end;
|
|
138
|
+ end;
|
|
139
|
+end;
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+function IsInstallDotNet(version: string; service: cardinal): boolean;
|
138
|
143
|
var
|
139
|
144
|
key, versionKey: string;
|
140
|
145
|
install, release, serviceCount, versionRelease: cardinal;
|
|
@@ -194,31 +199,14 @@ begin
|
194
|
199
|
result := success and (install = 1) and (serviceCount >= service);
|
195
|
200
|
end;
|
196
|
201
|
|
197
|
|
-function InitializeSetup: Boolean;
|
|
202
|
+// 检查.Net是否安装
|
|
203
|
+function CheckDotNet : Boolean;
|
198
|
204
|
var Path:string;
|
199
|
205
|
ResultCode: Integer;
|
200
|
206
|
begin
|
201
|
|
- if IsDotNetDetected('v4.5.2', 0) then
|
|
207
|
+ if IsInstallDotNet('v4.5.2', 0) then
|
202
|
208
|
begin
|
203
|
|
- if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{01FAEC41-B3BC-44F4-B185-5E8475AEB855}', 'Version') then
|
204
|
|
- begin
|
205
|
|
- Result := true;
|
206
|
|
- end
|
207
|
|
- else
|
208
|
|
- begin
|
209
|
|
- if MsgBox('系统检测到您没有安装VC++环境,是否立刻下载并安装?', mbConfirmation, MB_YESNO) = idYes then
|
210
|
|
- begin
|
211
|
|
- Path := ExpandConstant('{pf}/Internet Explorer/iexplore.exe');
|
212
|
|
- Exec(Path, 'https://xhkjedu.oss-cn-huhehaote.aliyuncs.com/runtime/VC_redist.x86.exe', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
|
213
|
|
- MsgBox('请安装好VC++环境后,再运行本安装包程序!',mbInformation,MB_OK);
|
214
|
|
- Result := false;
|
215
|
|
- end
|
216
|
|
- else
|
217
|
|
- begin
|
218
|
|
- MsgBox('取消后请手动安装VC2015-2019环境!',mbInformation,MB_OK);
|
219
|
|
- Result := true;
|
220
|
|
- end;
|
221
|
|
- end;
|
|
209
|
+ Result := true;
|
222
|
210
|
end
|
223
|
211
|
else
|
224
|
212
|
begin
|
|
@@ -237,6 +225,12 @@ begin
|
237
|
225
|
end;
|
238
|
226
|
end;
|
239
|
227
|
|
|
228
|
+function InitializeSetup: Boolean;
|
|
229
|
+begin
|
|
230
|
+ Result := CheckDotNet();
|
|
231
|
+ Result := CheckVC();
|
|
232
|
+end;
|
|
233
|
+
|
240
|
234
|
|
241
|
235
|
[CustomMessages]
|
242
|
|
-chinesesimp.checkSoftTip=安装程序检测到将安装的软件正在运行!%n%n点击"确定"终止软件后继续操作,否则点击"取消"。
|
|
236
|
+chinesesimp.checkSoftTip=安装程序检测到将安装的软件正在运行!%n%n点击"确定"终止软件后继续操作,否则点击"取消"。
|