Преглед изворни кода

升级VC版本

tags/对接微服务前
张剑 пре 3 година
родитељ
комит
d921b04c38
3 измењених фајлова са 90 додато и 103 уклоњено
  1. 2
    2
      XHWK.WKTool/App.config
  2. 43
    50
      星火微课/星火微课-正式.iss
  3. 45
    51
      星火微课/星火微课-测试.iss

+ 2
- 2
XHWK.WKTool/App.config Прегледај датотеку

@@ -9,8 +9,8 @@
9 9
     <!--参数是否加密 0不加密 1加密-->
10 10
     <add key="IsParameterEncryption" value="0" />
11 11
     <!--版本号-->
12
-    <add key="VersionCode" value="106" />
13
-    <add key="VersionName" value="3.1.12" />
12
+    <add key="VersionCode" value="107" />
13
+    <add key="VersionName" value="3.1.13" />
14 14
     <!--皮肤样式 0白 1蓝 2黑色 -->
15 15
     <add key="SkinStyle" value="0" />
16 16
     <!--是否输出视频记录日志:0否-->

+ 43
- 50
星火微课/星火微课-正式.iss Прегледај датотеку

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

+ 45
- 51
星火微课/星火微课-测试.iss Прегледај датотеку

@@ -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点击"确定"终止软件后继续操作,否则点击"取消"。

Loading…
Откажи
Сачувај