Browse Source

打包脚本

tags/3.0.0
张剑 3 years ago
parent
commit
dd55a97a46
3 changed files with 235 additions and 70 deletions
  1. 69
    69
      XHWK.WKTool/App.config
  2. 1
    1
      打包脚本/星火微课-正式.iss
  3. 165
    0
      打包脚本/星火微课-测试.iss

+ 69
- 69
XHWK.WKTool/App.config View File

@@ -1,72 +1,72 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <configuration>
3
-	<startup>
4
-		<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5
-	</startup>
6
-	<appSettings>
7
-		<!--0正式 1测试-->
8
-		<add key="IsDebug" value="1" />
9
-		<!--参数是否加密 0不加密 1加密-->
10
-		<add key="IsParameterEncryption" value="0" />
11
-		<!--版本号-->
12
-		<add key="VersionCode" value="91" />
13
-		<add key="VersionName" value="2.7.1" />
14
-		<!--皮肤样式 0白 1蓝 2黑色 -->
15
-		<add key="SkinStyle" value="0" />
16
-		<!--是否输出视频记录日志:0否-->
17
-		<add key="OutputVideoLog" value="0" />
18
-		<!--是否输出其他测试日志-->
19
-		<add key="IsOutputInfoLog" value="0" />
20
-		<!--文件存放路径  路径\账户名\讲解名称_x.MP4-->
21
-		<add key="VideoSavePath" value="D:\星火微课" />
22
-		<!--视频格式 1、MP4 2、FlV 3、AVI-->
23
-		<add key="VideoType" value="1" />
24
-		<!--是否录制扬声器 1 有 0 否-->
25
-		<add key="IsRecordingSound" value="1" />
26
-		<!--是否录制麦克风 1 有 0 否-->
27
-		<add key="IsRecordingMicrophone" value="1" />
28
-		<!--图片压缩质量 0最差 100最佳-->
29
-		<add key="ImageCompressionLevel" value="70" />
30
-		<!--用户名-->
31
-		<add key="userName" value="" />
32
-		<!--记住密码-->
33
-		<add key="isRemind" value="" />
34
-		<!--是否为校外 1是 -->
35
-		<add key="IsOutsideSchool" value="1" />
36
-		<!--API请求地址-->
37
-		<add key="APIRequestAddress" value="https://schoolapi.xhkjedu.com" />
38
-		<!--文件平台请求地址-->
39
-		<add key="FileRequestAddress" value="https://schoolfile.xhkjedu.com" />
40
-		<!--展示文件服务器请求地址-->
41
-		<add key="SchoolfileRequestAddress" value="https://schoolstatic.xhkjedu.com" />
42
-		<!--认证请求地址-->
43
-		<add key="CertapiRequestAddress" value="https://scapi.xhkjedu.com" />
44
-		<!--摄像头位置 1.右上 2.左上 3.右下 4.左下-->
45
-		<add key="CameraPosition" value="1" />
46
-		<!--上传每片大小 Mb-->
47
-		<add key="UploadSliceLen" value="1" />
48
-		<!--是否隐藏录屏工具栏 1 隐藏 0不隐藏-->
49
-		<add key="IsHideSRTool" value="1" />
50
-		<add key="ClientSettingsProvider.ServiceUri" value="" />
51
-	</appSettings>
52
-	<system.web>
53
-		<membership defaultProvider="ClientAuthenticationMembershipProvider">
54
-			<providers>
55
-				<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
56
-			</providers>
57
-		</membership>
58
-		<roleManager defaultProvider="ClientRoleProvider" enabled="true">
59
-			<providers>
60
-				<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
61
-			</providers>
62
-		</roleManager>
63
-	</system.web>
64
-	<runtime>
65
-		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
66
-			<dependentAssembly>
67
-				<assemblyIdentity name="itextsharp" publicKeyToken="8354ae6d2174ddca" culture="neutral" />
68
-				<bindingRedirect oldVersion="0.0.0.0-5.5.13.2" newVersion="5.5.13.2" />
69
-			</dependentAssembly>
70
-		</assemblyBinding>
71
-	</runtime>
3
+  <startup>
4
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5
+  </startup>
6
+  <appSettings>
7
+    <!--0正式 1测试-->
8
+    <add key="IsDebug" value="0" />
9
+    <!--参数是否加密 0不加密 1加密-->
10
+    <add key="IsParameterEncryption" value="0" />
11
+    <!--版本号-->
12
+    <add key="VersionCode" value="91" />
13
+    <add key="VersionName" value="2.7.1" />
14
+    <!--皮肤样式 0白 1蓝 2黑色 -->
15
+    <add key="SkinStyle" value="0" />
16
+    <!--是否输出视频记录日志:0否-->
17
+    <add key="OutputVideoLog" value="0" />
18
+    <!--是否输出其他测试日志-->
19
+    <add key="IsOutputInfoLog" value="0" />
20
+    <!--文件存放路径  路径\账户名\讲解名称_x.MP4-->
21
+    <add key="VideoSavePath" value="D:\星火微课" />
22
+    <!--视频格式 1、MP4 2、FlV 3、AVI-->
23
+    <add key="VideoType" value="1" />
24
+    <!--是否录制扬声器 1 有 0 否-->
25
+    <add key="IsRecordingSound" value="1" />
26
+    <!--是否录制麦克风 1 有 0 否-->
27
+    <add key="IsRecordingMicrophone" value="1" />
28
+    <!--图片压缩质量 0最差 100最佳-->
29
+    <add key="ImageCompressionLevel" value="70" />
30
+    <!--用户名-->
31
+    <add key="userName" value="" />
32
+    <!--记住密码-->
33
+    <add key="isRemind" value="" />
34
+    <!--是否为校外 1是 -->
35
+    <add key="IsOutsideSchool" value="1" />
36
+    <!--API请求地址-->
37
+    <add key="APIRequestAddress" value="https://schoolapi.xhkjedu.com" />
38
+    <!--文件平台请求地址-->
39
+    <add key="FileRequestAddress" value="https://schoolfile.xhkjedu.com" />
40
+    <!--展示文件服务器请求地址-->
41
+    <add key="SchoolfileRequestAddress" value="https://schoolstatic.xhkjedu.com" />
42
+    <!--认证请求地址-->
43
+    <add key="CertapiRequestAddress" value="https://scapi.xhkjedu.com" />
44
+    <!--摄像头位置 1.右上 2.左上 3.右下 4.左下-->
45
+    <add key="CameraPosition" value="1" />
46
+    <!--上传每片大小 Mb-->
47
+    <add key="UploadSliceLen" value="1" />
48
+    <!--是否隐藏录屏工具栏 1 隐藏 0不隐藏-->
49
+    <add key="IsHideSRTool" value="1" />
50
+    <add key="ClientSettingsProvider.ServiceUri" value="" />
51
+  </appSettings>
52
+  <system.web>
53
+    <membership defaultProvider="ClientAuthenticationMembershipProvider">
54
+      <providers>
55
+        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
56
+      </providers>
57
+    </membership>
58
+    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
59
+      <providers>
60
+        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
61
+      </providers>
62
+    </roleManager>
63
+  </system.web>
64
+  <runtime>
65
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
66
+      <dependentAssembly>
67
+        <assemblyIdentity name="itextsharp" publicKeyToken="8354ae6d2174ddca" culture="neutral" />
68
+        <bindingRedirect oldVersion="0.0.0.0-5.5.13.2" newVersion="5.5.13.2" />
69
+      </dependentAssembly>
70
+    </assemblyBinding>
71
+  </runtime>
72 72
 </configuration>

打包脚本/Inno Setup星火微课.iss → 打包脚本/星火微课-正式.iss View File

@@ -9,7 +9,7 @@
9 9
 #define MySourcePath "D:\Project\C#\xhwkclient\XHWK.WKTool\bin\x86\Debug\"
10 10
 #define MyAppExeName "星火微课.exe"
11 11
 #define MyIcoName "256.ico"
12
-#define MyTargetPath "D:\程序打包\星火微课\"
12
+#define MyTargetPath "D:\程序打包\星火微课-正式\"
13 13
 
14 14
 [Setup]
15 15
 ; 注: AppId的值为单独标识该应用程序。

+ 165
- 0
打包脚本/星火微课-测试.iss View File

@@ -0,0 +1,165 @@
1
+; 脚本由 Inno Setup 脚本向导 生成!
2
+; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!
3
+
4
+#define MyAppName "星火微课"  
5
+#define MyAppDir "xhwk"
6
+#define MyAppVersion "2.7.1"
7
+#define MyAppPublisher "河南星火燎原软件科技有限公司"
8
+#define MyAppURL "http://www.xhkjedu.com/"
9
+#define MySourcePath "D:\Project\C#\xhwkclient\XHWK.WKTool\bin\x86\Debug\"
10
+#define MyAppExeName "星火微课.exe"
11
+#define MyIcoName "256.ico"
12
+#define MyTargetPath "D:\程序打包\星火微课-测试\"
13
+
14
+[Setup]
15
+; 注: AppId的值为单独标识该应用程序。
16
+; 不要为其他安装程序使用相同的AppId值。
17
+; (若要生成新的 GUID,可在菜单中点击 "工具|生成 GUID"。)
18
+AppId={{5869900A-3BE4-463E-B0A6-462AA7454AE2}
19
+AppName={#MyAppName}
20
+AppVersion={#MyAppVersion}
21
+;AppVerName={#MyAppName} {#MyAppVersion}
22
+AppPublisher={#MyAppPublisher}
23
+AppPublisherURL={#MyAppURL}
24
+AppSupportURL={#MyAppURL}
25
+AppUpdatesURL={#MyAppURL}
26
+DefaultDirName={autopf}\{#MyAppDir}
27
+DisableProgramGroupPage=yes
28
+; [Icons] 的“quicklaunchicon”条目使用 {userappdata},而其 [Tasks] 条目具有适合 IsAdminInstallMode 的检查。
29
+UsedUserAreasWarning=no
30
+; 以下行取消注释,以在非管理安装模式下运行(仅为当前用户安装)。
31
+;PrivilegesRequired=lowest
32
+OutputDir={#MyTargetPath}
33
+OutputBaseFilename="{#MyAppName} v{#MyAppVersion}"
34
+SetupIconFile="{#MySourcePath}{#MyIcoName}"
35
+Compression=lzma
36
+SolidCompression=yes
37
+WizardStyle=modern
38
+
39
+[Languages]
40
+Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
41
+
42
+[Tasks]
43
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone
44
+Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
45
+
46
+[Files]
47
+Source: "{#MySourcePath}{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
48
+Source: "{#MySourcePath}*"; Excludes: "ffmpeg.exe,\Log\*,\Temp,\Data";DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
49
+
50
+[Icons]
51
+Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
52
+Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
53
+Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
54
+
55
+[Run]
56
+Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
57
+
58
+[Code]  
59
+// Indicates whether the specified version and service pack of the .NET Framework is installed.
60
+//
61
+// version -- Specify one of these strings for the required .NET Framework version:
62
+//    'v1.1'          .NET Framework 1.1
63
+//    'v2.0'          .NET Framework 2.0
64
+//    'v3.0'          .NET Framework 3.0
65
+//    'v3.5'          .NET Framework 3.5
66
+//    'v4\Client'     .NET Framework 4.0 Client Profile
67
+//    'v4\Full'       .NET Framework 4.0 Full Installation
68
+//    'v4.5'          .NET Framework 4.5
69
+//    'v4.5.1'        .NET Framework 4.5.1
70
+//    'v4.5.2'        .NET Framework 4.5.2
71
+//    'v4.6'          .NET Framework 4.6
72
+//    'v4.6.1'        .NET Framework 4.6.1
73
+//    'v4.6.2'        .NET Framework 4.6.2
74
+//    'v4.7'          .NET Framework 4.7
75
+//    'v4.7.1'        .NET Framework 4.7.1
76
+//    'v4.7.2'        .NET Framework 4.7.2
77
+//    'v4.8'          .NET Framework 4.8
78
+//
79
+// service -- Specify any non-negative integer for the required service pack level:
80
+//    0               No service packs required
81
+//    1, 2, etc.      Service pack 1, 2, etc. required
82
+function IsDotNetDetected(version: string; service: cardinal): boolean;
83
+var
84
+    key, versionKey: string;
85
+    install, release, serviceCount, versionRelease: cardinal;
86
+    success: boolean;
87
+begin
88
+    versionKey := version;
89
+    versionRelease := 0;
90
+
91
+    // .NET 1.1 and 2.0 embed release number in version key
92
+    if version = 'v1.1' then begin
93
+        versionKey := 'v1.1.4322';
94
+    end
95
+    else if version = 'v2.0' then begin
96
+        versionKey := 'v2.0.50727';
97
+    end
98
+
99
+    // .NET 4.5 and newer install as update to .NET 4.0 Full
100
+    else if Pos('v4.', version) = 1 then begin
101
+        versionKey := 'v4\Full';
102
+        case version of
103
+          'v4.5':   versionRelease := 378389;
104
+          'v4.5.1': versionRelease := 378675; // 378758 on Windows 8 and older
105
+          'v4.5.2': versionRelease := 379893;
106
+          'v4.6':   versionRelease := 393295; // 393297 on Windows 8.1 and older
107
+          'v4.6.1': versionRelease := 394254; // 394271 on Windows 8.1 and older
108
+          'v4.6.2': versionRelease := 394802; // 394806 on Windows 8.1 and older
109
+          'v4.7':   versionRelease := 460798; // Windows 10
110
+          'v4.7.1': versionRelease := 461308; // Windows 10
111
+          'v4.7.2': versionRelease := 461808; // Windows 10
112
+          'v4.8'  : versionRelease := 528040; // Windows 10
113
+        end;
114
+    end;
115
+
116
+    // installation key group for all .NET versions
117
+    key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\' + versionKey;
118
+
119
+    // .NET 3.0 uses value InstallSuccess in subkey Setup
120
+    if Pos('v3.0', version) = 1 then begin
121
+        success := RegQueryDWordValue(HKLM, key + '\Setup', 'InstallSuccess', install);
122
+    end else begin
123
+        success := RegQueryDWordValue(HKLM, key, 'Install', install);
124
+    end;
125
+
126
+    // .NET 4.0 and newer use value Servicing instead of SP
127
+    if Pos('v4', version) = 1 then begin
128
+        success := success and RegQueryDWordValue(HKLM, key, 'Servicing', serviceCount);
129
+    end else begin
130
+        success := success and RegQueryDWordValue(HKLM, key, 'SP', serviceCount);
131
+    end;
132
+
133
+    // .NET 4.5 and newer use additional value Release
134
+    if versionRelease > 0 then begin
135
+        success := success and RegQueryDWordValue(HKLM, key, 'Release', release);
136
+        success := success and (release >= versionRelease);
137
+    end;
138
+
139
+    result := success and (install = 1) and (serviceCount >= service);
140
+end;
141
+
142
+function InitializeSetup: Boolean;   
143
+var Path:string;   
144
+    ResultCode: Integer;   
145
+begin  
146
+  if  IsDotNetDetected('v4.5.2', 0) then  
147
+  begin  
148
+    Result := true;   
149
+  end  
150
+  else  
151
+  begin  
152
+    if MsgBox('系统检测到您没有安装.Net Framework4.5.2,是否立刻下载并安装?', mbConfirmation, MB_YESNO) = idYes then  
153
+    begin  
154
+      Path := ExpandConstant('{pf}/Internet Explorer/iexplore.exe');   
155
+      Exec(Path, 'https://xhkjedu.oss-cn-huhehaote.aliyuncs.com/runtime/NDP452-KB2901907-x86-x64-AllOS-ENU.exe', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);   
156
+      MsgBox('请安装好.Net Framework环境后,再运行本安装包程序!',mbInformation,MB_OK);   
157
+      Result := false;   
158
+    end  
159
+    else  
160
+    begin  
161
+      MsgBox('没有安装.Net Framework环境,无法运行程序,本安装程序即将退出!',mbInformation,MB_OK);   
162
+      Result := false;   
163
+    end;   
164
+  end;
165
+end;

Loading…
Cancel
Save