diff --git a/src/BuildUtil/BuildUtilCommands.cs b/src/BuildUtil/BuildUtilCommands.cs index 1858a3c0..3fd77482 100644 --- a/src/BuildUtil/BuildUtilCommands.cs +++ b/src/BuildUtil/BuildUtilCommands.cs @@ -255,14 +255,14 @@ namespace BuildUtil }; ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args); - int build, version; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - Win32BuildUtil.ReadBuildInfoFromTextFile(out build, out version, out name, out date); + Win32BuildUtil.ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); string baseName = string.Format("v{0}-{1}-{2}-{3:D4}.{4:D2}.{5:D2}", - BuildHelper.VersionIntToString(version), - build, + BuildHelper.VersionIntToString(versionMajor, versionMinor), + versionBuild, name, date.Year, date.Month, date.Day); @@ -389,9 +389,9 @@ namespace BuildUtil txt_cpu += " (x86 and x64)"; } - string txt_version = BuildHelper.VersionIntToString(version); + string txt_version = BuildHelper.VersionIntToString(versionMajor, versionMinor); - string txt_build = build.ToString(); + string txt_build = versionBuild.ToString(); string txt_verstr = name; @@ -435,7 +435,7 @@ namespace BuildUtil * */ string zipFileName = string.Format("VPN-CD-v{0}.{1:D2}-{2}-{3}-{4:D4}.{5:D2}.{6:D2}.zip", - version / 100, version % 100, build, name, + versionMajor, versionMinor, versionBuild, name, date.Year, date.Month, date.Day); w.WriteLine("del {0}", zipFileName); w.WriteLine("CD {0}", cddir); @@ -502,8 +502,8 @@ namespace BuildUtil txt.WriteLine("OS\t" + "Any"); txt.WriteLine("OSLIST\t" + "Any"); txt.WriteLine("CPU\t" + "CD-ROM"); - txt.WriteLine("VERSION\t" + BuildHelper.VersionIntToString(version)); - txt.WriteLine("BUILD\t" + build.ToString()); + txt.WriteLine("VERSION\t" + BuildHelper.VersionIntToString(versionMajor, versionMinor)); + txt.WriteLine("BUILD\t" + versionBuild.ToString()); txt.WriteLine("VERSTR\t" + name); txt.WriteLine("DATE\t" + Str.DateTimeToStrShortWithMilliSecs(date)); txt.WriteLine("LANGUAGE\t" + "English, Japanese, Simplified Chinese"); @@ -517,7 +517,7 @@ namespace BuildUtil "softether-" + #endif // BU_SOFTETHER string.Format("vpn_admin_tools-v{0}.{1:D2}-{2}-{3}-{4:D4}.{5:D2}.{6:D2}-win32.zip", - version / 100, version % 100, build, name, + versionMajor, versionMinor, versionBuild, name, date.Year, date.Month, date.Day); string vpnsmgr_zip_filename_full = Path.Combine(Path.Combine(publicDir, cddir), vpnsmgr_zip_filename_relative); @@ -556,8 +556,8 @@ namespace BuildUtil txt.WriteLine("OS\t" + "Windows (.zip package without installers)"); txt.WriteLine("OSLIST\t" + OSList.Windows.OSSimpleList); txt.WriteLine("CPU\t" + "Intel (x86 and x64)"); - txt.WriteLine("VERSION\t" + BuildHelper.VersionIntToString(version)); - txt.WriteLine("BUILD\t" + build.ToString()); + txt.WriteLine("VERSION\t" + BuildHelper.VersionIntToString(versionMajor, versionMinor)); + txt.WriteLine("BUILD\t" + versionBuild.ToString()); txt.WriteLine("VERSTR\t" + name); txt.WriteLine("DATE\t" + Str.DateTimeToStrShortWithMilliSecs(date)); txt.WriteLine("LANGUAGE\t" + "English, Japanese, Simplified Chinese"); @@ -616,10 +616,10 @@ namespace BuildUtil }; ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args); - int version, build; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - Win32BuildUtil.ReadBuildInfoFromTextFile(out build, out version, out name, out date); + Win32BuildUtil.ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); BuildSoftware[] softs = BuildSoftwareList.List; bool serial = vl["SERIAL"].BoolValue; @@ -630,7 +630,7 @@ namespace BuildUtil { if (soft.Os.IsWindows == false) { - soft.SetBuildNumberVersionName(build, version, name, date); + soft.SetBuildNumberVersionName(versionMajor, versionMinor, versionBuild, name, date); Con.WriteLine(" {0}", soft.IDString); Con.WriteLine(" - \"{0}\"", soft.OutputFileName); } @@ -658,7 +658,7 @@ namespace BuildUtil foreach (BuildSoftware soft in softs) { - soft.SetBuildNumberVersionName(build, version, name, date); + soft.SetBuildNumberVersionName(versionMajor, versionMinor, versionBuild, name, date); if (soft.Os.IsWindows == false) { @@ -772,10 +772,10 @@ namespace BuildUtil ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args); bool serial = vl["SERIAL"].BoolValue; - int version, build; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - Win32BuildUtil.ReadBuildInfoFromTextFile(out build, out version, out name, out date); + Win32BuildUtil.ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); BuildSoftware[] softs = BuildSoftwareList.List; if (Str.IsEmptyStr(vl.DefaultParam.StrValue)) @@ -785,7 +785,7 @@ namespace BuildUtil { if (soft.Os.IsWindows) { - soft.SetBuildNumberVersionName(build, version, name, date); + soft.SetBuildNumberVersionName(versionMajor, versionMinor, versionBuild, name, date); Con.WriteLine(" {0}", soft.IDString); Con.WriteLine(" - \"{0}\"", soft.OutputFileName); } @@ -813,7 +813,7 @@ namespace BuildUtil foreach (BuildSoftware soft in softs) { - soft.SetBuildNumberVersionName(build, version, name, date); + soft.SetBuildNumberVersionName(versionMajor, versionMinor, versionBuild, name, date); if (soft.Os.IsWindows) { diff --git a/src/BuildUtil/UnixBuildSoftwares.cs b/src/BuildUtil/UnixBuildSoftwares.cs index d2eec748..f11063c3 100644 --- a/src/BuildUtil/UnixBuildSoftwares.cs +++ b/src/BuildUtil/UnixBuildSoftwares.cs @@ -159,9 +159,9 @@ namespace BuildUtil public readonly string CrossCompilerOption; public readonly string SrcKitDefaultDir; - public BuildSoftwareUnix(Software software, int buildNumber, int version, string buildName, Cpu cpu, OS os, + public BuildSoftwareUnix(Software software, int versionMajor, int versionMinor, int versionBuild, string buildName, Cpu cpu, OS os, string crossLibName, bool useGccBitsOption, string crossCompilerName, bool noPthreadOption, string crossCompilerOption) - : base(software, buildNumber, version, buildName, cpu, os) + : base(software, versionMajor, versionMinor, versionBuild, buildName, cpu, os) { this.CrossLibName = crossLibName; this.UseGccBitsOption = useGccBitsOption; @@ -431,13 +431,13 @@ namespace BuildUtil { get { - int build, version; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - Win32BuildUtil.ReadBuildInfoFromTextFile(out build, out version, out name, out date); + Win32BuildUtil.ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); return string.Format("{0}-{3}-{1}.tar.gz", "srckit", this.CrossLibName, Str.DateTimeToStrShort(BuildSoftwareList.ListCreatedDateTime), - build); + versionBuild); } } diff --git a/src/BuildUtil/VpnBuilder.cs b/src/BuildUtil/VpnBuilder.cs index b1b63f58..1e4c5242 100644 --- a/src/BuildUtil/VpnBuilder.cs +++ b/src/BuildUtil/VpnBuilder.cs @@ -194,7 +194,7 @@ namespace BuildUtil // Build public static void BuildMain(BuildSoftware soft, bool debugModeIfUnix) { - int version, build; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; @@ -203,9 +203,9 @@ namespace BuildUtil try { - Win32BuildUtil.ReadBuildInfoFromTextFile(out build, out version, out name, out date); + Win32BuildUtil.ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); - soft.SetBuildNumberVersionName(build, version, name, date); + soft.SetBuildNumberVersionName(versionMajor, versionMinor, versionBuild, name, date); Con.WriteLine("Building '{0}' - {1}...", soft.IDString, soft.TitleString); @@ -227,9 +227,9 @@ namespace BuildUtil } // Convert the number to a version number - public static string VersionIntToString(int version) + public static string VersionIntToString(int versionMajor, int versionMinor) { - return string.Format("{0}.{1:D2}", version / 100, version % 100); + return string.Format("{0}.{1:D2}", versionMajor, versionMinor); } // Get a product list that is included in the software diff --git a/src/BuildUtil/VpnBuilderConfig.cs b/src/BuildUtil/VpnBuilderConfig.cs index 474ba304..07fc17b8 100644 --- a/src/BuildUtil/VpnBuilderConfig.cs +++ b/src/BuildUtil/VpnBuilderConfig.cs @@ -150,100 +150,100 @@ namespace BuildUtil // ========== Windows ========== // Server and Bridge public static readonly BuildSoftware vpnserver_win32_x86x64_ja = - new BuildSoftwareWin32(Software.vpnserver_vpnbridge, 0, 0, "", CpuList.intel, OSList.Windows); + new BuildSoftwareWin32(Software.vpnserver_vpnbridge, 0, 0, 0, "", CpuList.intel, OSList.Windows); // Client public static readonly BuildSoftware vpnclient_win32_x86x64_ja = - new BuildSoftwareWin32(Software.vpnclient, 0, 0, "", CpuList.intel, OSList.Windows); + new BuildSoftwareWin32(Software.vpnclient, 0, 0, 0, "", CpuList.intel, OSList.Windows); // ========== Linux ========== // Server public static readonly BuildSoftware vpnserver_linux_x86_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x86, OSList.Linux, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.x86, OSList.Linux, "linux-x86-32bit", true, "linux-x86-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnserver_linux_x64_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x64, OSList.Linux, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.x64, OSList.Linux, "linux-x86-64bit", true, "linux-x86-64bit-3.4.6", false, null); public static readonly BuildSoftware vpnserver_linux_arm_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.arm, OSList.Linux, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.arm, OSList.Linux, "linux-arm-32bit", false, "linux-arm-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnserver_linux_armeabi_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.armeabi, OSList.Linux, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.armeabi, OSList.Linux, "linux-armeabi-32bit", false, "linux-armeabi-32bit-4.3.2", true, null); public static readonly BuildSoftware vpnserver_linux_mipsel_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.mipsel, OSList.Linux, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.mipsel, OSList.Linux, "linux-mipsel-32bit", false, "linux-mipsel-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnserver_linux_ppc_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.ppc32, OSList.Linux, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.ppc32, OSList.Linux, "linux-ppc-32bit", false, "linux-ppc-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnserver_linux_sh4_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.sh4, OSList.Linux, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.sh4, OSList.Linux, "linux-sh4-32bit", false, "linux-sh4-32bit-3.4.6", false, null); // Client public static readonly BuildSoftware vpnclient_linux_x86_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.x86, OSList.Linux, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.x86, OSList.Linux, "linux-x86-32bit", true, "linux-x86-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnclient_linux_x64_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.x64, OSList.Linux, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.x64, OSList.Linux, "linux-x86-64bit", true, "linux-x86-64bit-3.4.6", false, null); public static readonly BuildSoftware vpnclient_linux_arm_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.arm, OSList.Linux, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.arm, OSList.Linux, "linux-arm-32bit", false, "linux-arm-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnclient_linux_armeabi_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.armeabi, OSList.Linux, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.armeabi, OSList.Linux, "linux-armeabi-32bit", false, "linux-armeabi-32bit-4.3.2", true, null); public static readonly BuildSoftware vpnclient_linux_mipsel_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.mipsel, OSList.Linux, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.mipsel, OSList.Linux, "linux-mipsel-32bit", false, "linux-mipsel-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnclient_linux_ppc_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.ppc32, OSList.Linux, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.ppc32, OSList.Linux, "linux-ppc-32bit", false, "linux-ppc-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnclient_linux_sh4_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.sh4, OSList.Linux, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.sh4, OSList.Linux, "linux-sh4-32bit", false, "linux-sh4-32bit-3.4.6", false, null); // Bridge public static readonly BuildSoftware vpnbridge_linux_x86_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x86, OSList.Linux, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.x86, OSList.Linux, "linux-x86-32bit", true, "linux-x86-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnbridge_linux_x64_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x64, OSList.Linux, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.x64, OSList.Linux, "linux-x86-64bit", true, "linux-x86-64bit-3.4.6", false, null); public static readonly BuildSoftware vpnbridge_linux_arm_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.arm, OSList.Linux, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.arm, OSList.Linux, "linux-arm-32bit", false, "linux-arm-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnbridge_linux_armeabi_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.armeabi, OSList.Linux, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.armeabi, OSList.Linux, "linux-armeabi-32bit", false, "linux-armeabi-32bit-4.3.2", true, null); public static readonly BuildSoftware vpnbridge_linux_mipsel_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.mipsel, OSList.Linux, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.mipsel, OSList.Linux, "linux-mipsel-32bit", false, "linux-mipsel-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnbridge_linux_ppc_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.ppc32, OSList.Linux, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.ppc32, OSList.Linux, "linux-ppc-32bit", false, "linux-ppc-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnbridge_linux_sh4_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.sh4, OSList.Linux, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.sh4, OSList.Linux, "linux-sh4-32bit", false, "linux-sh4-32bit-3.4.6", false, null); @@ -251,21 +251,21 @@ namespace BuildUtil // ========== FreeBSD ========== // Server public static readonly BuildSoftware vpnserver_bsd_x86_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x86, OSList.FreeBSD, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.x86, OSList.FreeBSD, "freebsd-x86-32bit", true, "freebsd-x86-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnserver_bsd_x64_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x64, OSList.FreeBSD, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.x64, OSList.FreeBSD, "freebsd-x86-64bit", true, "freebsd-x86-64bit-3.4.6", false, null); // Bridge public static readonly BuildSoftware vpnbridge_bsd_x86_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x86, OSList.FreeBSD, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.x86, OSList.FreeBSD, "freebsd-x86-32bit", true, "freebsd-x86-32bit-3.4.6", false, null); public static readonly BuildSoftware vpnbridge_bsd_x64_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x64, OSList.FreeBSD, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.x64, OSList.FreeBSD, "freebsd-x86-64bit", true, "freebsd-x86-64bit-3.4.6", false, null); @@ -273,92 +273,92 @@ namespace BuildUtil // ========== Mac OS X ========== // Server public static readonly BuildSoftware vpnserver_macos_ppc32_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.ppc32, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.ppc32, OSList.MacOS, "macos-ppc-32bit", true, "macos-ppc-32bit-4.0.4", true, "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); public static readonly BuildSoftware vpnserver_macos_ppc64_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.ppc64, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.ppc64, OSList.MacOS, "macos-ppc-64bit", true, "macos-ppc-64bit-4.0.4", true, null); public static readonly BuildSoftware vpnserver_macos_x86_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x86, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.x86, OSList.MacOS, "macos-x86-32bit", true, "macos-x86-32bit-4.0.4", true, "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); public static readonly BuildSoftware vpnserver_macos_x64_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x64, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.x64, OSList.MacOS, "macos-x86-64bit", true, "macos-x86-64bit-4.0.4", true, null); // Client public static readonly BuildSoftware vpnclient_macos_ppc32_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.ppc32, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.ppc32, OSList.MacOS, "macos-ppc-32bit", true, "macos-ppc-32bit-4.0.4", true, "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); public static readonly BuildSoftware vpnclient_macos_ppc64_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.ppc64, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.ppc64, OSList.MacOS, "macos-ppc-64bit", true, "macos-ppc-64bit-4.0.4", true, null); public static readonly BuildSoftware vpnclient_macos_x86_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.x86, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.x86, OSList.MacOS, "macos-x86-32bit", true, "macos-x86-32bit-4.0.4", true, "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); public static readonly BuildSoftware vpnclient_macos_x64_ja = - new BuildSoftwareUnix(Software.vpnclient, 0, 0, "", CpuList.x64, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnclient, 0, 0, 0, "", CpuList.x64, OSList.MacOS, "macos-x86-64bit", true, "macos-x86-64bit-4.0.4", true, null); // Bridge public static readonly BuildSoftware vpnbridge_macos_ppc32_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.ppc32, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.ppc32, OSList.MacOS, "macos-ppc-32bit", true, "macos-ppc-32bit-4.0.4", true, "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); public static readonly BuildSoftware vpnbridge_macos_ppc64_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.ppc64, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.ppc64, OSList.MacOS, "macos-ppc-64bit", true, "macos-ppc-64bit-4.0.4", true, null); public static readonly BuildSoftware vpnbridge_macos_x86_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x86, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.x86, OSList.MacOS, "macos-x86-32bit", true, "macos-x86-32bit-4.0.4", true, "-isysroot /cygdrive/s/CommomDev/xc/common/apple_xcode/xcode_2.4/Developer/SDKs/MacOSX10.4u.sdk"); public static readonly BuildSoftware vpnbridge_macos_x64_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x64, OSList.MacOS, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.x64, OSList.MacOS, "macos-x86-64bit", true, "macos-x86-64bit-4.0.4", true, null); // ========== Solaris ========== // Server public static readonly BuildSoftware vpnserver_solaris_sparc32_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.sparc32, OSList.Solaris, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.sparc32, OSList.Solaris, "solaris-sparc-32bit", true, "solaris-sparc-32bit-3.4.6", true, null); public static readonly BuildSoftware vpnserver_solaris_sparc64_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.sparc64, OSList.Solaris, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.sparc64, OSList.Solaris, "solaris-sparc-64bit", true, "solaris-sparc-64bit-3.4.6", true, null); public static readonly BuildSoftware vpnserver_solaris_x86_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x86, OSList.Solaris, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.x86, OSList.Solaris, "solaris-x86-32bit", true, "solaris-x86-32bit-3.4.6", true, null); public static readonly BuildSoftware vpnserver_solaris_x64_ja = - new BuildSoftwareUnix(Software.vpnserver, 0, 0, "", CpuList.x64, OSList.Solaris, + new BuildSoftwareUnix(Software.vpnserver, 0, 0, 0, "", CpuList.x64, OSList.Solaris, "solaris-x86-64bit", true, "solaris-x86-64bit-3.4.6", true, null); // Bridge public static readonly BuildSoftware vpnbridge_solaris_sparc32_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.sparc32, OSList.Solaris, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.sparc32, OSList.Solaris, "solaris-sparc-32bit", true, "solaris-sparc-32bit-3.4.6", true, null); public static readonly BuildSoftware vpnbridge_solaris_sparc64_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.sparc64, OSList.Solaris, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.sparc64, OSList.Solaris, "solaris-sparc-64bit", true, "solaris-sparc-64bit-3.4.6", true, null); public static readonly BuildSoftware vpnbridge_solaris_x86_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x86, OSList.Solaris, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.x86, OSList.Solaris, "solaris-x86-32bit", true, "solaris-x86-32bit-3.4.6", true, null); public static readonly BuildSoftware vpnbridge_solaris_x64_ja = - new BuildSoftwareUnix(Software.vpnbridge, 0, 0, "", CpuList.x64, OSList.Solaris, + new BuildSoftwareUnix(Software.vpnbridge, 0, 0, 0, "", CpuList.x64, OSList.Solaris, "solaris-x86-64bit", true, "solaris-x86-64bit-3.4.6", true, null); diff --git a/src/BuildUtil/VpnBuilderConfigTypes.cs b/src/BuildUtil/VpnBuilderConfigTypes.cs index ba190f53..2b62a04c 100644 --- a/src/BuildUtil/VpnBuilderConfigTypes.cs +++ b/src/BuildUtil/VpnBuilderConfigTypes.cs @@ -187,27 +187,30 @@ namespace BuildUtil public class BuildSoftware { public Software Software; // Software - public int Version; // Version number - public int BuildNumber; // Build Number + public int VersionMajor; // Version number (major) + public int VersionMinor; // Version number (minor) + public int VersionBuild; // Version number (build) public string BuildName; // Build name public Cpu Cpu; // CPU public OS Os; // OS public DateTime BuildDate; // Build date - public BuildSoftware(Software software, int buildNumber, int version, string buildName, Cpu cpu, OS os) + public BuildSoftware(Software software, int versionMajor, int versionMinor, int versionBuild, string buildName, Cpu cpu, OS os) { this.Software = software; - this.BuildNumber = buildNumber; - this.Version = version; + this.VersionMajor = versionMajor; + this.VersionMinor = versionMinor; + this.VersionBuild = versionBuild; this.BuildName = buildName; this.Cpu = cpu; this.Os = os; } - public void SetBuildNumberVersionName(int buildNumber, int version, string buildName, DateTime date) + public void SetBuildNumberVersionName(int versionMajor, int versionMinor, int versionBuild, string buildName, DateTime date) { - this.BuildNumber = buildNumber; - this.Version = version; + this.VersionMajor = versionMajor; + this.VersionMinor = versionMinor; + this.VersionBuild = versionBuild; this.BuildName = buildName; this.BuildDate = date; } @@ -243,8 +246,11 @@ namespace BuildUtil } this.Software = (Software)Enum.Parse(typeof(Software), tokens[0], true); - this.Version = (int)(double.Parse(tokens[1].Substring(1)) * 100); - this.BuildNumber = int.Parse(tokens[2]); + + string[] vs = tokens[1].Substring(1).Split('.'); + this.VersionMajor = int.Parse(vs[0]); + this.VersionMinor = int.Parse(vs[1]); + this.VersionBuild = int.Parse(tokens[2]); this.BuildName = tokens[3]; string[] ds = tokens[4].Split('.'); @@ -260,12 +266,12 @@ namespace BuildUtil { return string.Format("{0}-v{6}-{1}-{2}-{8:D4}.{9:D2}.{10:D2}-{4}-{3}-{7}", Paths.Prefix + this.Software.ToString(), - this.BuildNumber, + this.VersionBuild, this.BuildName, this.Cpu.Name, this.Os.Name, 0, - BuildHelper.VersionIntToString(this.Version), + BuildHelper.VersionIntToString(this.VersionMajor, this.VersionMinor), CPUBitsUtil.CPUBitsToString(this.Cpu.Bits), BuildDate.Year, BuildDate.Month, BuildDate.Day).ToLower(); } @@ -291,7 +297,7 @@ namespace BuildUtil get { return string.Format("{0} (Ver {2}, Build {1}, {3}) for {5}", BuildHelper.GetSoftwareTitle(this.Software), - this.BuildNumber, BuildHelper.VersionIntToString(this.Version), this.Cpu.Title, 0, this.Os.Title); + this.VersionBuild, BuildHelper.VersionIntToString(this.VersionMajor, this.VersionMinor), this.Cpu.Title, 0, this.Os.Title); } } diff --git a/src/BuildUtil/Win32BuildSoftware.cs b/src/BuildUtil/Win32BuildSoftware.cs index dcf2586b..6c4018c7 100644 --- a/src/BuildUtil/Win32BuildSoftware.cs +++ b/src/BuildUtil/Win32BuildSoftware.cs @@ -138,8 +138,8 @@ namespace BuildUtil // Build Win32 software public class BuildSoftwareWin32 : BuildSoftware { - public BuildSoftwareWin32(Software software, int buildNumber, int version, string buildName, Cpu cpu, OS os) - : base(software, buildNumber, version, buildName, cpu, os) + public BuildSoftwareWin32(Software software, int versionMajor, int versionMinor, int versionBuild, string buildName, Cpu cpu, OS os) + : base(software, versionMajor, versionMinor, versionBuild, buildName, cpu, os) { } diff --git a/src/BuildUtil/Win32BuildUtil.cs b/src/BuildUtil/Win32BuildUtil.cs index e3b85cd2..1edc9d9c 100644 --- a/src/BuildUtil/Win32BuildUtil.cs +++ b/src/BuildUtil/Win32BuildUtil.cs @@ -140,12 +140,12 @@ namespace BuildUtil // Generate vpnweb.ocx public static void GenerateVpnWebOcxCab(string dstFileName, string ocxFileName) { - int build, version; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - ReadBuildInfoFromTextFile(out build, out version, out name, out date); + ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); - string cabVer = string.Format("{0},{1},0,{2}", version / 100, version % 100, build); + string cabVer = string.Format("{0},{1},0,{2}", versionMajor, versionMinor, versionBuild); string cabFileName = IO.CreateTempFileNameByExt(".cab"); Mutex m = new Mutex(false, "cabtmp_mutex"); @@ -183,10 +183,10 @@ namespace BuildUtil // Generate a version information resource public static void GenerateVersionInfoResource(string targetExeName, string outName, string rc_name, string product_name) { - int build, version; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - ReadBuildInfoFromTextFile(out build, out version, out name, out date); + ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); if (Str.IsEmptyStr(rc_name)) { @@ -214,9 +214,9 @@ namespace BuildUtil body = Str.ReplaceStr(body, "$INTERNALNAME$", internalName); body = Str.ReplaceStr(body, "$YEAR$", date.Year.ToString()); body = Str.ReplaceStr(body, "$FILENAME$", exeFileName); - body = Str.ReplaceStr(body, "$VER_MAJOR$", (version / 100).ToString()); - body = Str.ReplaceStr(body, "$VER_MINOR$", (version % 100).ToString()); - body = Str.ReplaceStr(body, "$VER_BUILD$", build.ToString()); + body = Str.ReplaceStr(body, "$VER_MAJOR$", versionMajor.ToString()); + body = Str.ReplaceStr(body, "$VER_MINOR$", versionMinor.ToString()); + body = Str.ReplaceStr(body, "$VER_BUILD$", versionBuild.ToString()); IO f = IO.CreateTempFileByExt(".rc"); string filename = f.Name; @@ -258,47 +258,48 @@ namespace BuildUtil // Increment the build number public static void IncrementBuildNumber() { - int build, version; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - ReadBuildInfoFromTextFile(out build, out version, out name, out date); - build++; + ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); + versionBuild++; - WriteBuildInfoToTextFile(build, version, name, date); + WriteBuildInfoToTextFile(versionMajor, versionMinor, versionBuild, name, date); SetNowDate(); - Con.WriteLine("New build number: {0}", build); + Con.WriteLine("New build number: {0}", versionBuild); } // Set the date and time public static void SetNowDate() { - int build, version; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - ReadBuildInfoFromTextFile(out build, out version, out name, out date); + ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); date = DateTime.Now; - WriteBuildInfoToTextFile(build, version, name, date); + WriteBuildInfoToTextFile(versionMajor, versionMinor, versionBuild, name, date); } // Write the build number and the version number in the text file - public static void WriteBuildInfoToTextFile(int build, int version, string name, DateTime date) + public static void WriteBuildInfoToTextFile(int versionMajor, int versionMinor, int versionBuild, string name, DateTime date) { string filename = Path.Combine(Paths.BaseDirName, "CurrentBuild.txt"); - WriteBuildInfoToTextFile(build, version, name, date, filename); + WriteBuildInfoToTextFile(versionMajor, versionMinor, versionBuild, name, date, filename); } - public static void WriteBuildInfoToTextFile(int build, int version, string name, DateTime date, string filename) + public static void WriteBuildInfoToTextFile(int versionMajor, int versionMinor, int versionBuild, string name, DateTime date, string filename) { using (StreamWriter w = new StreamWriter(filename)) { - w.WriteLine("BUILD_NUMBER {0}", build); - w.WriteLine("VERSION {0}", version); + w.WriteLine("VERSION_MAJOR {0}", versionMajor); + w.WriteLine("VERSION_MINOR {0}", versionMinor); + w.WriteLine("VERSION_BUILD {0}", versionBuild); w.WriteLine("BUILD_NAME {0}", name); w.WriteLine("BUILD_DATE {0}", Str.DateTimeToStrShort(date)); @@ -308,13 +309,13 @@ namespace BuildUtil } // Read the build number and the version number from a text file - public static void ReadBuildInfoFromTextFile(out int build, out int version, out string name, out DateTime date) + public static void ReadBuildInfoFromTextFile(out int versionMajor, out int versionMinor, out int versionBuild, out string name, out DateTime date) { string filename = Path.Combine(Paths.BaseDirName, "CurrentBuild.txt"); - ReadBuildInfoFromTextFile(out build, out version, out name, out date, filename); + ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date, filename); } - public static void ReadBuildInfoFromTextFile(out int build, out int version, out string name, out DateTime date, string filename) + public static void ReadBuildInfoFromTextFile(out int versionMajor, out int versionMinor, out int versionBuild, out string name, out DateTime date, string filename) { char[] seps = { '\t', ' ', }; name = ""; @@ -322,7 +323,7 @@ namespace BuildUtil using (StreamReader r = new StreamReader(filename)) { - build = version = 0; + versionBuild = versionMinor = versionMajor = 0; while (true) { @@ -335,14 +336,19 @@ namespace BuildUtil string[] tokens = line.Split(seps, StringSplitOptions.RemoveEmptyEntries); if (tokens.Length == 2) { - if (tokens[0].Equals("BUILD_NUMBER", StringComparison.InvariantCultureIgnoreCase)) + if (tokens[0].Equals("VERSION_MAJOR", StringComparison.InvariantCultureIgnoreCase)) { - build = int.Parse(tokens[1]); + versionMajor = int.Parse(tokens[1]); } - if (tokens[0].Equals("VERSION", StringComparison.InvariantCultureIgnoreCase)) + if (tokens[0].Equals("VERSION_MINOR", StringComparison.InvariantCultureIgnoreCase)) { - version = int.Parse(tokens[1]); + versionMinor = int.Parse(tokens[1]); + } + + if (tokens[0].Equals("VERSION_BUILD", StringComparison.InvariantCultureIgnoreCase)) + { + versionBuild = int.Parse(tokens[1]); } if (tokens[0].Equals("BUILD_NAME", StringComparison.InvariantCultureIgnoreCase)) @@ -361,7 +367,7 @@ namespace BuildUtil r.Close(); - if (build == 0 || version == 0 || Str.IsEmptyStr(name) || date.Ticks == 0) + if (versionBuild == 0 || versionMinor == 0 || versionMajor == 0 || Str.IsEmptyStr(name) || date.Ticks == 0) { throw new ApplicationException(string.Format("Wrong file data: '{0}'", filename)); } @@ -373,18 +379,18 @@ namespace BuildUtil { SetNowDate(); - int build, version; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - ReadBuildInfoFromTextFile(out build, out version, out name, out date); + ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); string username = Env.UserName; string pcname = Env.MachineName; - NormalizeSourceCode(build, version, username, pcname, date); + NormalizeSourceCode(versionMajor, versionMinor, versionBuild, username, pcname, date); } // Apply build number, version number, user name, and PC name to the source code - public static void NormalizeSourceCode(int buildNumber, int version, string userName, string pcName, DateTime date) + public static void NormalizeSourceCode(int versionMajor, int versionMinor, int versionBuild, string userName, string pcName, DateTime date) { DateTime now = date; char[] seps = { '\t', ' ', }; @@ -439,7 +445,7 @@ namespace BuildUtil // Build number portion of the source code if (tokens[0].Equals("//") && tokens[1].Equals("Build") && Str.IsNumber(tokens[2])) { - newLine = line.Replace(tokens[2], buildNumber.ToString()); + newLine = line.Replace(tokens[2], versionBuild.ToString()); } } } @@ -449,14 +455,19 @@ namespace BuildUtil if (tokens.Length == 3) { // String part of the version information of Cedar.h - if (tokens[0].Equals("#define") && tokens[1].Equals("CEDAR_BUILD")) + if (tokens[0].Equals("#define") && tokens[1].Equals("CEDAR_VERSION_MAJOR")) { - newLine = line.Replace(tokens[2], buildNumber.ToString()); + newLine = line.Replace(tokens[2], versionMajor.ToString()); } - if (tokens[0].Equals("#define") && tokens[1].Equals("CEDAR_VER")) + if (tokens[0].Equals("#define") && tokens[1].Equals("CEDAR_VERSION_MINOR")) { - newLine = line.Replace(tokens[2], version.ToString()); + newLine = line.Replace(tokens[2], versionMinor.ToString()); + } + + if (tokens[0].Equals("#define") && tokens[1].Equals("CEDAR_VERSION_BUILD")) + { + newLine = line.Replace(tokens[2], versionBuild.ToString()); } if (tokens[0].Equals("#define") && tokens[1].Equals("BUILDER_NAME")) @@ -848,11 +859,11 @@ namespace BuildUtil // Create and sign the Inf file and the catalog file for SeLow public static void SignSeLowInfFiles(string cpu) { - int build, version; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - ReadBuildInfoFromTextFile(out build, out version, out name, out date); + ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); string hamcore = Path.Combine(Paths.BinDirName, "hamcore"); string sys_src = Path.Combine(hamcore, "SeLow_" + cpu + ".sys"); @@ -868,7 +879,7 @@ namespace BuildUtil throw new ApplicationException(sys_src + " is not signed."); } - generateINFFilesForPlatform(inf_src, sys_src, null, dst_dir, version, build, date, true); + generateINFFilesForPlatform(inf_src, sys_src, null, dst_dir, versionMajor, versionMinor, versionBuild, date, true); Con.WriteLine("Generating INF Files for SeLow Ok."); } @@ -876,10 +887,10 @@ namespace BuildUtil // Create Inf file for Windows 8 public static void GenerateINFFilesForWindows8(string cpu) { - int build, version; + int versionMajor, versionMinor, versionBuild; string name; DateTime date; - ReadBuildInfoFromTextFile(out build, out version, out name, out date); + ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out name, out date); string hamcore = Path.Combine(Paths.BinDirName, "hamcore"); string inf_src_x86 = Path.Combine(hamcore, "vpn_driver.inf"); @@ -901,7 +912,7 @@ namespace BuildUtil throw new ApplicationException(sys_src_x64 + " is not signed."); } - generateINFFilesForPlatform(inf_src_x64, sys_src_x64, sys6_src_x64, dst_x64, version, build, date, false); + generateINFFilesForPlatform(inf_src_x64, sys_src_x64, sys6_src_x64, dst_x64, versionMajor, versionMinor, versionBuild, date, false); } else { @@ -910,12 +921,12 @@ namespace BuildUtil throw new ApplicationException(sys_src_x86 + " is not signed."); } - generateINFFilesForPlatform(inf_src_x86, sys_src_x86, sys6_src_x86, dst_x86, version, build, date, false); + generateINFFilesForPlatform(inf_src_x86, sys_src_x86, sys6_src_x86, dst_x86, versionMajor, versionMinor, versionBuild, date, false); } Con.WriteLine("Generating INF Files for Windows 8 Ok."); } - static void generateINFFilesForPlatform(string inf, string sys, string sys6, string dstDir, int ver, int build, DateTime date, bool selow) + static void generateINFFilesForPlatform(string inf, string sys, string sys6, string dstDir, int versionMajor, int versionMinor, int versionBuild, DateTime date, bool selow) { string cdfFileName = Path.Combine(dstDir, "inf.cdf"); @@ -1000,9 +1011,9 @@ namespace BuildUtil body = Str.ReplaceStr(body, "$YEAR$", date.Year.ToString("D4")); body = Str.ReplaceStr(body, "$MONTH$", date.Month.ToString("D2")); body = Str.ReplaceStr(body, "$DAY$", date.Day.ToString("D2")); - body = Str.ReplaceStr(body, "$VER_MAJOR$", (ver / 100).ToString()); - body = Str.ReplaceStr(body, "$VER_MINOR$", (ver % 100).ToString()); - body = Str.ReplaceStr(body, "$VER_BUILD$", build.ToString()); + body = Str.ReplaceStr(body, "$VER_MAJOR$", versionMajor.ToString()); + body = Str.ReplaceStr(body, "$VER_MINOR$", versionMinor.ToString()); + body = Str.ReplaceStr(body, "$VER_BUILD$", versionBuild.ToString()); body = Str.ReplaceStr(body, "[Manufacturer]", "CatalogFile.NT\t\t\t\t= inf_" + name + ".cat\r\n\r\n[Manufacturer]"); string dst_inf_name = Path.Combine(dstDir, "INF_" + name + ".inf"); @@ -1060,7 +1071,7 @@ namespace BuildUtil } } - static string process_inf_file(string src_inf_txt, int build, int ver, DateTime date, string sys_name, string name, string catfile, bool replace_mac_address) + static string process_inf_file(string src_inf_txt, int versionMajor, int versionMinor, int versionBuild, DateTime date, string sys_name, string name, string catfile, bool replace_mac_address) { string body = src_inf_txt; @@ -1079,9 +1090,9 @@ namespace BuildUtil body = Str.ReplaceStr(body, "$YEAR$", date.Year.ToString("D4")); body = Str.ReplaceStr(body, "$MONTH$", date.Month.ToString("D2")); body = Str.ReplaceStr(body, "$DAY$", date.Day.ToString("D2")); - body = Str.ReplaceStr(body, "$VER_MAJOR$", (ver / 100).ToString()); - body = Str.ReplaceStr(body, "$VER_MINOR$", (ver % 100).ToString()); - body = Str.ReplaceStr(body, "$VER_BUILD$", build.ToString()); + body = Str.ReplaceStr(body, "$VER_MAJOR$", versionMajor.ToString()); + body = Str.ReplaceStr(body, "$VER_MINOR$", versionMinor.ToString()); + body = Str.ReplaceStr(body, "$VER_BUILD$", versionBuild.ToString()); if (Str.IsEmptyStr(catfile) == false) { @@ -1150,12 +1161,12 @@ namespace BuildUtil public static void MakeDriverPackage() { - int build, version; + int versionMajor, versionMinor, versionBuild; string buildname; DateTime date; int i; - ReadBuildInfoFromTextFile(out build, out version, out buildname, out date); + ReadBuildInfoFromTextFile(out versionMajor, out versionMinor, out versionBuild, out buildname, out date); date = date.AddDays(-1); @@ -1167,31 +1178,31 @@ namespace BuildUtil // Neo9x x86 IO.MakeDir(Path.Combine(dst_dir, @"Neo9x\x86")); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Neo9x\x86\Neo9x_x86.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo9x\x86\Neo9x_x86.inf")), build, version, date, null, null, null, false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo9x\x86\Neo9x_x86.inf")), versionMajor, versionMinor, versionBuild, date, null, null, null, false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"Neo9x\x86\Neo9x_x86.sys"), Path.Combine(dst_dir, @"Neo9x\x86\Neo9x_x86.sys")); // Neo x86 IO.MakeDir(Path.Combine(dst_dir, @"Neo\x86")); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Neo\x86\Neo_x86.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo\x86\Neo_x86.inf")), build, version, date, null, null, null, false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo\x86\Neo_x86.inf")), versionMajor, versionMinor, versionBuild, date, null, null, null, false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"Neo\x86\Neo_x86.sys"), Path.Combine(dst_dir, @"Neo\x86\Neo_x86.sys")); // Neo x64 IO.MakeDir(Path.Combine(dst_dir, @"Neo\x64")); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Neo\x64\Neo_x64.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo\x64\Neo_x64.inf")), build, version, date, null, null, null, false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo\x64\Neo_x64.inf")), versionMajor, versionMinor, versionBuild, date, null, null, null, false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"Neo\x64\Neo_x64.sys"), Path.Combine(dst_dir, @"Neo\x64\Neo_x64.sys")); // Neo6 x86 IO.MakeDir(Path.Combine(dst_dir, @"Neo6\x86")); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Neo6\x86\Neo6_x86.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x86\Neo6_x86.inf")), build, version, date, null, null, null, false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x86\Neo6_x86.inf")), versionMajor, versionMinor, versionBuild, date, null, null, null, false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"Neo6\x86\Neo6_x86.sys"), Path.Combine(dst_dir, @"Neo6\x86\Neo6_x86.sys")); // Neo6 x64 IO.MakeDir(Path.Combine(dst_dir, @"Neo6\x64")); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Neo6\x64\Neo6_x64.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x64\Neo6_x64.inf")), build, version, date, null, null, null, false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x64\Neo6_x64.inf")), versionMajor, versionMinor, versionBuild, date, null, null, null, false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"Neo6\x64\Neo6_x64.sys"), Path.Combine(dst_dir, @"Neo6\x64\Neo6_x64.sys")); // Neo6 for Windows 8 x86 @@ -1207,7 +1218,7 @@ namespace BuildUtil } string sys_name = "Neo_" + name + ".sys"; IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Neo6_Win8\x86\Neo6_x86_" + name + ".inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x86\Neo6_x86.inf")), build, version, date, sys_name, name, string.Format("inf_{0}.cat", name), true), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x86\Neo6_x86.inf")), versionMajor, versionMinor, versionBuild, date, sys_name, name, string.Format("inf_{0}.cat", name), true), Str.ShiftJisEncoding, false); cat_src_filename.Add("Neo6_x86_" + name + ".inf"); } IO.FileCopy(Path.Combine(src_dir, @"Neo6\x86\Neo6_x86.sys"), Path.Combine(dst_dir, @"Neo6_Win8\x86\Neo6_x86.sys")); @@ -1227,7 +1238,7 @@ namespace BuildUtil } string sys_name = "Neo_" + name + ".sys"; IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Neo6_Win8\x64\Neo6_x64_" + name + ".inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x64\Neo6_x64.inf")), build, version, date, sys_name, name, string.Format("inf_{0}.cat", name), true), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x64\Neo6_x64.inf")), versionMajor, versionMinor, versionBuild, date, sys_name, name, string.Format("inf_{0}.cat", name), true), Str.ShiftJisEncoding, false); cat_src_filename.Add("Neo6_x64_" + name + ".inf"); } IO.FileCopy(Path.Combine(src_dir, @"Neo6\x64\Neo6_x64.sys"), Path.Combine(dst_dir, @"Neo6_Win8\x64\Neo6_x64.sys")); @@ -1247,7 +1258,7 @@ namespace BuildUtil cat_src_filename.Add("Neo6_x86_" + name + ".sys"); string sys_name = "Neo6_x86_" + name + ".sys"; IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Neo6_Win10\x86\Neo6_x86_" + name + ".inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x86\Neo6_x86.inf")), build, version, date, sys_name, name, string.Format("Neo6_x86_{0}.cat", name), true), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x86\Neo6_x86.inf")), versionMajor, versionMinor, versionBuild, date, sys_name, name, string.Format("Neo6_x86_{0}.cat", name), true), Str.ShiftJisEncoding, false); cat_src_filename.Add("Neo6_x86_" + name + ".inf"); IO.FileCopy(Path.Combine(src_dir, @"Neo6\x86\Neo6_x86_win10.sys"), Path.Combine(dst_dir, @"Neo6_Win10\x86\Neo6_x86_" + name + ".sys")); make_cat_file(Path.Combine(dst_dir, @"Neo6_Win10\x86"), cat_src_filename.ToArray(), "Neo6_x86_" + name + ".cat", true, true); @@ -1266,7 +1277,7 @@ namespace BuildUtil cat_src_filename.Add("Neo6_x64_" + name + ".sys"); string sys_name = "Neo6_x64_" + name + ".sys"; IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Neo6_Win10\x64\Neo6_x64_" + name + ".inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x64\Neo6_x64.inf")), build, version, date, sys_name, name, string.Format("Neo6_x64_{0}.cat", name), true), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Neo6\x64\Neo6_x64.inf")), versionMajor, versionMinor, versionBuild, date, sys_name, name, string.Format("Neo6_x64_{0}.cat", name), true), Str.ShiftJisEncoding, false); cat_src_filename.Add("Neo6_x64_" + name + ".inf"); IO.FileCopy(Path.Combine(src_dir, @"Neo6\x64\Neo6_x64_win10.sys"), Path.Combine(dst_dir, @"Neo6_Win10\x64\Neo6_x64_" + name + ".sys")); make_cat_file(Path.Combine(dst_dir, @"Neo6_Win10\x64"), cat_src_filename.ToArray(), "Neo6_x64_" + name + ".cat", true, true); @@ -1280,7 +1291,7 @@ namespace BuildUtil cat_src_filename.Add("SeLow_x86.sys"); cat_src_filename.Add("SeLow_x86.inf"); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"SeLow_Win8\x86\SeLow_x86.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"SeLow\x86\SeLow_x86.inf")), build, version, date, null, null, "SeLow_Win8_x86.cat", false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"SeLow\x86\SeLow_x86.inf")), versionMajor, versionMinor, versionBuild, date, null, null, "SeLow_Win8_x86.cat", false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"SeLow\x86\SeLow_x86.sys"), Path.Combine(dst_dir, @"SeLow_Win8\x86\SeLow_x86.sys")); make_cat_file(Path.Combine(dst_dir, @"SeLow_Win8\x86"), cat_src_filename.ToArray(), "inf.cat", false, false); make_cat_file(Path.Combine(dst_dir, @"SeLow_Win8\x86"), cat_src_filename.ToArray(), "inf2.cat", true, false); @@ -1291,7 +1302,7 @@ namespace BuildUtil cat_src_filename.Add("SeLow_x64.sys"); cat_src_filename.Add("SeLow_x64.inf"); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"SeLow_Win8\x64\SeLow_x64.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"SeLow\x64\SeLow_x64.inf")), build, version, date, null, null, "SeLow_Win8_x64.cat", false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"SeLow\x64\SeLow_x64.inf")), versionMajor, versionMinor, versionBuild, date, null, null, "SeLow_Win8_x64.cat", false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"SeLow\x64\SeLow_x64.sys"), Path.Combine(dst_dir, @"SeLow_Win8\x64\SeLow_x64.sys")); make_cat_file(Path.Combine(dst_dir, @"SeLow_Win8\x64"), cat_src_filename.ToArray(), "inf.cat", false, false); make_cat_file(Path.Combine(dst_dir, @"SeLow_Win8\x64"), cat_src_filename.ToArray(), "inf2.cat", true, false); @@ -1302,7 +1313,7 @@ namespace BuildUtil cat_src_filename.Add("SeLow_x86.sys"); cat_src_filename.Add("SeLow_x86.inf"); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"SeLow_Win10\x86\SeLow_x86.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"SeLow\x86\SeLow_x86.inf")), build, version, date, null, null, "SeLow_Win10_x86.cat", false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"SeLow\x86\SeLow_x86.inf")), versionMajor, versionMinor, versionBuild, date, null, null, "SeLow_Win10_x86.cat", false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"SeLow\x86\SeLow_x86_win10.sys"), Path.Combine(dst_dir, @"SeLow_Win10\x86\SeLow_x86.sys")); make_cat_file(Path.Combine(dst_dir, @"SeLow_Win10\x86"), cat_src_filename.ToArray(), "SeLow_Win10_x86.cat", true, false); @@ -1312,7 +1323,7 @@ namespace BuildUtil cat_src_filename.Add("SeLow_x64.sys"); cat_src_filename.Add("SeLow_x64.inf"); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"SeLow_Win10\x64\SeLow_x64.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"SeLow\x64\SeLow_x64.inf")), build, version, date, null, null, "SeLow_Win10_x64.cat", false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"SeLow\x64\SeLow_x64.inf")), versionMajor, versionMinor, versionBuild, date, null, null, "SeLow_Win10_x64.cat", false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"SeLow\x64\SeLow_x64_win10.sys"), Path.Combine(dst_dir, @"SeLow_Win10\x64\SeLow_x64.sys")); make_cat_file(Path.Combine(dst_dir, @"SeLow_Win10\x64"), cat_src_filename.ToArray(), "SeLow_Win10_x64.cat", true, false); @@ -1322,7 +1333,7 @@ namespace BuildUtil cat_src_filename.Add("pxwfp_x86.sys"); cat_src_filename.Add("pxwfp_x86.inf"); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Wfp\x86\pxwfp_x86.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Wfp\x86\pxwfp_x86.inf")), build, version, date, null, null, "pxwfp_x86.cat", false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Wfp\x86\pxwfp_x86.inf")), versionMajor, versionMinor, versionBuild, date, null, null, "pxwfp_x86.cat", false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"Wfp\x86\pxwfp_x86.sys"), Path.Combine(dst_dir, @"Wfp\x86\pxwfp_x86.sys")); make_cat_file(Path.Combine(dst_dir, @"Wfp\x86"), cat_src_filename.ToArray(), "inf.cat", false, false); make_cat_file(Path.Combine(dst_dir, @"Wfp\x86"), cat_src_filename.ToArray(), "inf2.cat", true, false); @@ -1333,7 +1344,7 @@ namespace BuildUtil cat_src_filename.Add("pxwfp_x64.sys"); cat_src_filename.Add("pxwfp_x64.inf"); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Wfp\x64\pxwfp_x64.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Wfp\x64\pxwfp_x64.inf")), build, version, date, null, null, "pxwfp_x64.cat", false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Wfp\x64\pxwfp_x64.inf")), versionMajor, versionMinor, versionBuild, date, null, null, "pxwfp_x64.cat", false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"Wfp\x64\pxwfp_x64.sys"), Path.Combine(dst_dir, @"Wfp\x64\pxwfp_x64.sys")); make_cat_file(Path.Combine(dst_dir, @"Wfp\x64"), cat_src_filename.ToArray(), "inf.cat", false, false); make_cat_file(Path.Combine(dst_dir, @"Wfp\x64"), cat_src_filename.ToArray(), "inf2.cat", true, false); @@ -1344,7 +1355,7 @@ namespace BuildUtil cat_src_filename.Add("pxwfp_x86.sys"); cat_src_filename.Add("pxwfp_x86.inf"); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Wfp_Win10\x86\pxwfp_x86.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Wfp\x86\pxwfp_x86.inf")), build, version, date, null, null, "pxwfp_Win10_x86.cat", false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Wfp\x86\pxwfp_x86.inf")), versionMajor, versionMinor, versionBuild, date, null, null, "pxwfp_Win10_x86.cat", false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"Wfp\x86\pxwfp_x86_win10.sys"), Path.Combine(dst_dir, @"Wfp_Win10\x86\pxwfp_x86.sys")); make_cat_file(Path.Combine(dst_dir, @"Wfp_Win10\x86"), cat_src_filename.ToArray(), "pxwfp_Win10_x86.cat", true, false); @@ -1354,19 +1365,19 @@ namespace BuildUtil cat_src_filename.Add("pxwfp_x64.sys"); cat_src_filename.Add("pxwfp_x64.inf"); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, @"Wfp_Win10\x64\pxwfp_x64.inf"), - process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Wfp\x64\pxwfp_x64.inf")), build, version, date, null, null, "pxwfp_Win10_x64.cat", false), Str.ShiftJisEncoding, false); + process_inf_file(IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, @"Wfp\x64\pxwfp_x64.inf")), versionMajor, versionMinor, versionBuild, date, null, null, "pxwfp_Win10_x64.cat", false), Str.ShiftJisEncoding, false); IO.FileCopy(Path.Combine(src_dir, @"Wfp\x64\pxwfp_x64_win10.sys"), Path.Combine(dst_dir, @"Wfp_Win10\x64\pxwfp_x64.sys")); make_cat_file(Path.Combine(dst_dir, @"Wfp_Win10\x64"), cat_src_filename.ToArray(), "pxwfp_Win10_x64.cat", true, false); string tmp_body = IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, "make_whql_submission.cm_")); - tmp_body = Str.ReplaceStr(tmp_body, "test_tag", Str.DateTimeToStrShort(DateTime.Now) + "_Build_" + build.ToString()); + tmp_body = Str.ReplaceStr(tmp_body, "test_tag", Str.DateTimeToStrShort(DateTime.Now) + "_Build_" + versionBuild.ToString()); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, "make_whql_submission.cmd"), tmp_body, Str.ShiftJisEncoding); IO.FileCopy(Path.Combine(src_dir, "2_merge_whql_sign.cm_"), Path.Combine(dst_dir, "2_merge_whql_sign.cm_")); tmp_body = IO.ReadAllTextWithAutoGetEncoding(Path.Combine(src_dir, "Memo.txt")); - tmp_body = Str.ReplaceStr(tmp_body, "tag_ver", (version / 100).ToString() + "." + (version % 100).ToString()); - tmp_body = Str.ReplaceStr(tmp_body, "tag_build", build.ToString()); + tmp_body = Str.ReplaceStr(tmp_body, "tag_ver", versionMajor.ToString() + "." + versionMinor.ToString()); + tmp_body = Str.ReplaceStr(tmp_body, "tag_build", versionBuild.ToString()); IO.WriteAllTextWithEncoding(Path.Combine(dst_dir, "Memo.txt"), tmp_body, Str.ShiftJisEncoding); Kernel.Run(Path.Combine(Env.WindowsDir, "explorer.exe"), "\"" + dst_dir + "\""); diff --git a/src/Cedar/BridgeWin32.c b/src/Cedar/BridgeWin32.c index 653b0bc5..eb6f8873 100644 --- a/src/Cedar/BridgeWin32.c +++ b/src/Cedar/BridgeWin32.c @@ -1961,7 +1961,7 @@ HINSTANCE InstallPcdDriverInternal() if (IsFileExists(tmp)) { // If driver file is exist, try to get build number from registry - if (LoadPcdDriverBuild() >= CEDAR_BUILD) + if (LoadPcdDriverBuild() >= CEDAR_VERSION_BUILD) { // Already latest driver is installed install_driver = false; @@ -1990,7 +1990,7 @@ HINSTANCE InstallPcdDriverInternal() } // Save build number - SavePcdDriverBuild(CEDAR_BUILD); + SavePcdDriverBuild(CEDAR_VERSION_BUILD); } dll_filename = BRIDGE_WIN32_PCD_DLL; diff --git a/src/Cedar/CM.c b/src/Cedar/CM.c index 36eceaa3..5434c06c 100644 --- a/src/Cedar/CM.c +++ b/src/Cedar/CM.c @@ -4419,7 +4419,7 @@ UINT CmMainWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *p if (CmGetNumConnected(hWnd) == 0) { cm->Update = InitUpdateUi(_UU("PRODUCT_NAME_VPN_CMGR"), NAME_OF_VPN_CLIENT_MANAGER, NULL, - GetCurrentBuildDate(), CEDAR_BUILD, CEDAR_VER, ((cm->Client == NULL) ? NULL : cm->Client->ClientId), + GetCurrentBuildDate(), CEDAR_VERSION_BUILD, GetCedarVersionNumber(), ((cm->Client == NULL) ? NULL : cm->Client->ClientId), true); } } @@ -11171,7 +11171,7 @@ void CmMainWindowOnInit(HWND hWnd) UniStrCpy(cm->StatudBar1, sizeof(cm->StatudBar1), _UU("CM_TITLE")); UniStrCpy(cm->StatudBar2, sizeof(cm->StatudBar2), _UU("CM_CONN_NO")); - UniFormat(cm->StatudBar3, sizeof(cm->StatudBar3), _UU("CM_PRODUCT_NAME"), CEDAR_BUILD); + UniFormat(cm->StatudBar3, sizeof(cm->StatudBar3), _UU("CM_PRODUCT_NAME"), CEDAR_VERSION_BUILD); cm->Icon2 = LoadSmallIcon(ICO_SERVER_OFFLINE); cm->Icon3 = LoadSmallIcon(ICO_VPN); diff --git a/src/Cedar/Cedar.c b/src/Cedar/Cedar.c index aaee7d86..16694de2 100644 --- a/src/Cedar/Cedar.c +++ b/src/Cedar/Cedar.c @@ -1517,9 +1517,19 @@ void GetCedarVersion(char *tmp, UINT size) return; } - Format(tmp, size, "%u.%02u.%u", - CEDAR_VER / 100, CEDAR_VER - (CEDAR_VER / 100) * 100, - CEDAR_BUILD); + Format(tmp, size, "%u.%02u.%u", CEDAR_VERSION_MAJOR, CEDAR_VERSION_MINOR, CEDAR_VERSION_BUILD); +} + +UINT GetCedarVersionNumber() +{ + UINT pow = 10; + + while (CEDAR_VERSION_MAJOR >= pow) + { + pow *= 10; + } + + return CEDAR_VERSION_MAJOR * pow + CEDAR_VERSION_MINOR; } // Create Cedar object @@ -1581,8 +1591,8 @@ CEDAR *NewCedar(X *server_x, K *server_k) c->ServerX = CloneX(server_x); } - c->Version = CEDAR_VER; - c->Build = CEDAR_BUILD; + c->Version = GetCedarVersionNumber(); + c->Build = CEDAR_VERSION_BUILD; c->ServerStr = CopyStr(CEDAR_SERVER_STR); GetMachineName(tmp, sizeof(tmp)); @@ -1628,8 +1638,7 @@ CEDAR *NewCedar(X *server_x, K *server_k) ToStr(tmp2, c->Beta); Format(tmp, sizeof(tmp), "Version %u.%02u Build %u %s %s (%s)", - CEDAR_VER / 100, CEDAR_VER - (CEDAR_VER / 100) * 100, - CEDAR_BUILD, + CEDAR_VERSION_MAJOR, CEDAR_VERSION_MINOR, CEDAR_VERSION_BUILD, c->Beta == 0 ? "" : beta_str, c->Beta == 0 ? "" : tmp2, _SS("LANGSTR")); diff --git a/src/Cedar/Cedar.h b/src/Cedar/Cedar.h index 328e8c04..990287d7 100644 --- a/src/Cedar/Cedar.h +++ b/src/Cedar/Cedar.h @@ -135,10 +135,18 @@ // Version number -#define CEDAR_VER 501 +#ifndef CEDAR_VERSION_MAJOR +#define CEDAR_VERSION_MAJOR 0 +#endif // CEDAR_VERSION_MAJOR + +#ifndef CEDAR_VERSION_MINOR +#define CEDAR_VERSION_MINOR 0 +#endif // CEDAR_VER_MINOR // Build Number -#define CEDAR_BUILD 9657 +#ifndef CEDAR_VERSION_BUILD +#define CEDAR_VERSION_BUILD 0 +#endif // CEDAR_VERSION_BUILD // Beta number //#define BETA_NUMBER 3 @@ -148,21 +156,38 @@ // Specify the name of the person in charge building #ifndef BUILDER_NAME -#define BUILDER_NAME "yagi" +#define BUILDER_NAME "Unknown" #endif // BUILDER_NAME // Specify the location to build #ifndef BUILD_PLACE -#define BUILD_PLACE "pc37" +#define BUILD_PLACE "Unknown" #endif // BUILD_PLACE // Specifies the build date -#define BUILD_DATE_Y 2018 +#ifndef BUILD_DATE_Y +#define BUILD_DATE_Y 1970 +#endif // BUILD_DATE_Y + +#ifndef BUILD_DATE_M #define BUILD_DATE_M 1 -#define BUILD_DATE_D 14 +#endif // BUILD_DATE_M + +#ifndef BUILD_DATE_D +#define BUILD_DATE_D 1 +#endif // BUILD_DATE_D + +#ifndef BUILD_DATE_HO #define BUILD_DATE_HO 0 -#define BUILD_DATE_MI 36 -#define BUILD_DATE_SE 20 +#endif // BUILD_DATE_HO + +#ifndef BUILD_DATE_MI +#define BUILD_DATE_MI 0 +#endif // BUILD_DATE_MI + +#ifndef BUILD_DATE_SE +#define BUILD_DATE_SE 0 +#endif // BUILD_DATE_SE // Tolerable time difference #define ALLOW_TIMESTAMP_DIFF (UINT64)(3 * 24 * 60 * 60 * 1000) @@ -1243,6 +1268,7 @@ bool IsSupportedWinVer(RPC_WINVER *v); SOCK *GetInProcListeningSock(CEDAR *c); SOCK *GetReverseListeningSock(CEDAR *c); void GetCedarVersion(char *tmp, UINT size); +UINT GetCedarVersionNumber(); UINT64 GetCurrentBuildDate(); void CedarAddCurrentTcpQueueSize(CEDAR *c, int diff); UINT CedarGetCurrentTcpQueueSize(CEDAR *c); diff --git a/src/Cedar/Client.c b/src/Cedar/Client.c index 86f0e126..1c55a467 100644 --- a/src/Cedar/Client.c +++ b/src/Cedar/Client.c @@ -8078,7 +8078,6 @@ bool CtGetVLan(CLIENT *c, RPC_CLIENT_GET_VLAN *get) // Initialize the driver version information structure void CiInitDriverVerStruct(MS_DRIVER_VER *ver) { - UINT cedar_ver = CEDAR_VER; // Validate arguments if (ver == NULL) { @@ -8090,9 +8089,9 @@ void CiInitDriverVerStruct(MS_DRIVER_VER *ver) ver->Year = BUILD_DATE_Y; ver->Month = BUILD_DATE_M; ver->Day = BUILD_DATE_D; - ver->Major = cedar_ver / 100; - ver->Minor = cedar_ver % 100; - ver->Build = CEDAR_BUILD; + ver->Major = CEDAR_VERSION_MAJOR; + ver->Minor = CEDAR_VERSION_MINOR; + ver->Build = CEDAR_VERSION_BUILD; } #endif // OS_WIN32 diff --git a/src/Cedar/Command.c b/src/Cedar/Command.c index d8fb64c0..675760b5 100644 --- a/src/Cedar/Command.c +++ b/src/Cedar/Command.c @@ -1004,7 +1004,7 @@ void VpnCmdInitBootPath() // Get the version of vpncmd that is currently installed current_ver = MsRegReadInt(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_VER); - if ((CEDAR_BUILD >= current_ver) || + if ((CEDAR_VERSION_BUILD >= current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) { char *src_filename; @@ -1035,7 +1035,7 @@ void VpnCmdInitBootPath() if (MsIs64BitWindows() == false || Is64()) { - if (IsFile(tmp) == false || (CEDAR_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) + if (IsFile(tmp) == false || (CEDAR_VERSION_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) { b = FileCopy(src_filename, tmp); } @@ -1048,7 +1048,7 @@ void VpnCmdInitBootPath() if (true) { - if (IsFile(tmp) == false || (CEDAR_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) + if (IsFile(tmp) == false || (CEDAR_VERSION_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) { b = FileCopy(src_filename, tmp); } @@ -1058,7 +1058,7 @@ void VpnCmdInitBootPath() if (true) { - if (IsFile(tmp) == false || (CEDAR_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) + if (IsFile(tmp) == false || (CEDAR_VERSION_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) { b = FileCopy(src_filename, tmp); } @@ -1069,15 +1069,15 @@ void VpnCmdInitBootPath() if (MsIs64BitWindows() == false) { MsRegWriteStr(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH, exe_path); - MsRegWriteInt(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_VER, CEDAR_BUILD); + MsRegWriteInt(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_VER, CEDAR_VERSION_BUILD); } else { MsRegWriteStrEx2(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH, exe_path, true, false); - MsRegWriteIntEx2(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_VER, CEDAR_BUILD, true, false); + MsRegWriteIntEx2(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_VER, CEDAR_VERSION_BUILD, true, false); MsRegWriteStrEx2(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH, exe_path, false, true); - MsRegWriteIntEx2(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_VER, CEDAR_BUILD, false, true); + MsRegWriteIntEx2(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_VER, CEDAR_VERSION_BUILD, false, true); } } } diff --git a/src/Cedar/IPsec_Win7.c b/src/Cedar/IPsec_Win7.c index 85dbfc9f..6c749edf 100644 --- a/src/Cedar/IPsec_Win7.c +++ b/src/Cedar/IPsec_Win7.c @@ -358,7 +358,7 @@ bool IPsecWin7InitDriverInner() if (IsFileExists(sys_filename) && MsIsServiceInstalled(IPSEC_WIN7_DRIVER_NAME)) { - if (GetCurrentIPsecWin7DriverBuild() >= CEDAR_BUILD) + if (GetCurrentIPsecWin7DriverBuild() >= CEDAR_VERSION_BUILD) { // Not to install since the latest version has been already installed install_driver = false; @@ -485,7 +485,7 @@ void SetCurrentIPsecWin7DriverBuild() { MsRegWriteInt(REG_LOCAL_MACHINE, IPSEC_WIN7_DRIVER_REGKEY, (MsIsWindows10() ? IPSEC_WIN7_DRIVER_BUILDNUMBER_WIN10 : IPSEC_WIN7_DRIVER_BUILDNUMBER), - CEDAR_BUILD); + CEDAR_VERSION_BUILD); } // Get the build number of the current driver diff --git a/src/Cedar/Protocol.c b/src/Cedar/Protocol.c index 665498e4..1d8cec71 100644 --- a/src/Cedar/Protocol.c +++ b/src/Cedar/Protocol.c @@ -1489,8 +1489,8 @@ bool ServerAccept(CONNECTION *c) { StrCpy(c->ClientStr, sizeof(c->ClientStr), "Unknown"); } - c->ServerVer = CEDAR_VER; - c->ServerBuild = CEDAR_BUILD; + c->ServerVer = GetCedarVersionNumber(); + c->ServerBuild = CEDAR_VERSION_BUILD; // Get the NODE_INFO Zero(&node, sizeof(node)); diff --git a/src/Cedar/SM.c b/src/Cedar/SM.c index d656e007..c9db8257 100644 --- a/src/Cedar/SM.c +++ b/src/Cedar/SM.c @@ -20270,7 +20270,7 @@ UINT SmMainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *para // Updater start sm->Update = InitUpdateUi(_UU("PRODUCT_NAME_VPN_SMGR"), NAME_OF_VPN_SERVER_MANAGER, NULL, GetCurrentBuildDate(), - CEDAR_BUILD, CEDAR_VER, NULL, false); + CEDAR_VERSION_BUILD, GetCedarVersionNumber(), NULL, false); break; case WM_TIMER: diff --git a/src/Cedar/SW.c b/src/Cedar/SW.c index 6457ba7e..1f832d07 100644 --- a/src/Cedar/SW.c +++ b/src/Cedar/SW.c @@ -896,9 +896,7 @@ void SwGenerateDefaultSfxFileName(wchar_t *name, UINT size) } UniFormat(name, size, L"easy-" GC_SW_SOFTETHER_PREFIX_W L"vpnclient-v%u.%02u-%u-%04u-%02u-%02u-windows.exe", - CEDAR_VER / 100, - CEDAR_VER % 100, - CEDAR_BUILD, + CEDAR_VERSION_MAJOR, CEDAR_VERSION_MINOR, CEDAR_VERSION_BUILD, BUILD_DATE_Y, BUILD_DATE_M, BUILD_DATE_D); } @@ -912,9 +910,7 @@ void SwGenerateDefaultZipFileName(wchar_t *name, UINT size) } UniFormat(name, size, L"web-" GC_SW_SOFTETHER_PREFIX_W L"vpnclient-v%u.%02u-%u-%04u-%02u-%02u-windows.zip", - CEDAR_VER / 100, - CEDAR_VER % 100, - CEDAR_BUILD, + CEDAR_VERSION_MAJOR, CEDAR_VERSION_MINOR, CEDAR_VERSION_BUILD, BUILD_DATE_Y, BUILD_DATE_M, BUILD_DATE_D); } @@ -2941,15 +2937,13 @@ bool SwWebMain(SW *sw, WIZARD_PAGE *wp) char package_name[MAX_SIZE]; ZIP_PACKER *z = NULL; - ToStr(ver_major, CEDAR_VER / 100); - ToStr(ver_minor, CEDAR_VER % 100); - ToStr(ver_build, CEDAR_BUILD); + ToStr(ver_major, CEDAR_VERSION_MAJOR); + ToStr(ver_minor, CEDAR_VERSION_MINOR); + ToStr(ver_build, CEDAR_VERSION_BUILD); Format(package_name, sizeof(package_name), GC_SW_SOFTETHER_PREFIX "vpnclient-v%u.%02u-%u-%04u-%02u-%02u-windows.exe", - CEDAR_VER / 100, - CEDAR_VER % 100, - CEDAR_BUILD, + CEDAR_VERSION_MAJOR, CEDAR_VERSION_MINOR, CEDAR_VERSION_BUILD, BUILD_DATE_Y, BUILD_DATE_M, BUILD_DATE_D); GetCurrentLang(¤t_lang); @@ -3947,7 +3941,7 @@ L_RETRY_LOG: sw->LogFile->IsSystemMode = sw->IsSystemMode; sw->LogFile->Component = sw->CurrentComponent; - sw->LogFile->Build = CEDAR_BUILD; + sw->LogFile->Build = CEDAR_VERSION_BUILD; if (SwSaveLogFile(sw, log_filename, sw->LogFile) == false) { @@ -3978,7 +3972,7 @@ L_RETRY_LOG: MsRegWriteStrEx2W(sw->IsSystemMode ? REG_LOCAL_MACHINE : REG_CURRENT_USER, keyname, "InstalledDir", sw->InstallDir, false, true); MsRegWriteIntEx2(sw->IsSystemMode ? REG_LOCAL_MACHINE : REG_CURRENT_USER, - keyname, "InstalledBuild", CEDAR_BUILD, false, true); + keyname, "InstalledBuild", CEDAR_VERSION_BUILD, false, true); // Set the language to registry MsRegWriteStrEx2(REG_CURRENT_USER, SW_REG_KEY, "Last User Language", @@ -5032,7 +5026,7 @@ UINT SwDir(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, WIZARD *wizard, WI break; } - if (logfile != NULL && (logfile->Build > CEDAR_BUILD) && UniIsEmptyStr(sw->auto_setting_path) == false && + if (logfile != NULL && (logfile->Build > CEDAR_VERSION_BUILD) && UniIsEmptyStr(sw->auto_setting_path) == false && sw->CurrentComponent->Id == SW_CMP_VPN_CLIENT && logfile->Component->Id == SW_CMP_VPN_CLIENT) { // In the case of the VPN Client, show a message if a newer version is installed and @@ -5054,7 +5048,7 @@ UINT SwDir(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, WIZARD *wizard, WI { errmsg = _UU("SW_DIR_DST_IS_OTHER_PRODUCT"); } - else if ((skip_ver_check == false) && (logfile->Build > CEDAR_BUILD)) + else if ((skip_ver_check == false) && (logfile->Build > CEDAR_VERSION_BUILD)) { errmsg = _UU("SW_DIR_DST_IS_NEWER"); } diff --git a/src/Cedar/WinUi.c b/src/Cedar/WinUi.c index 364eb54c..2130b0cd 100644 --- a/src/Cedar/WinUi.c +++ b/src/Cedar/WinUi.c @@ -3537,7 +3537,7 @@ void AboutDlgInit(HWND hWnd, WINUI_ABOUT *a) SetText(hWnd, 0, tmp); SetFont(hWnd, S_INFO1, GetFont("Arial", 12, false, false, false, false)); - FormatText(hWnd, S_INFO1, CEDAR_VER / 100, CEDAR_VER / 100, CEDAR_VER % 100, CEDAR_BUILD); + FormatText(hWnd, S_INFO1, CEDAR_VERSION_MAJOR, CEDAR_VERSION_MAJOR, CEDAR_VERSION_MINOR, CEDAR_VERSION_BUILD); SetFont(hWnd, S_INFO2, GetFont("Arial", 8, false, false, false, false)); FormatText(hWnd, S_INFO2, BUILD_DATE_Y, a->Cedar->BuildInfo); diff --git a/src/CurrentBuild.txt b/src/CurrentBuild.txt index e43199cf..ca4d8e5b 100644 --- a/src/CurrentBuild.txt +++ b/src/CurrentBuild.txt @@ -1,4 +1,5 @@ -BUILD_NUMBER 9657 -VERSION 501 +VERSION_MAJOR 5 +VERSION_MINOR 1 +VERSION_BUILD 9657 BUILD_NAME unstable BUILD_DATE 20180113_003620