|
|
|
@ -33,13 +33,14 @@ public partial class InstallWindow : Window |
|
|
|
|
* 6.写入注册表安装位置,首次安装时间(留后续升级用) |
|
|
|
|
* 7.复制完成 ->安装完成 |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
if (InstallSprakCheck()) |
|
|
|
|
{ |
|
|
|
|
InstallProgressBar.Visibility = Visibility.Visible; |
|
|
|
|
StatusTextBlock.Visibility = Visibility.Visible; |
|
|
|
|
Install.IsEnabled = false; |
|
|
|
|
TestCutUrl.IsEnabled = false; |
|
|
|
|
DeviceCode.IsEnabled = false; |
|
|
|
|
// DeviceCode.IsEnabled = false; |
|
|
|
|
DefaultPassword.IsEnabled = false; |
|
|
|
|
DefaultUserName.IsEnabled = false; |
|
|
|
|
BrowseInstallPath.IsEnabled = false; |
|
|
|
@ -55,7 +56,7 @@ public partial class InstallWindow : Window |
|
|
|
|
{ |
|
|
|
|
Install.IsEnabled = true; |
|
|
|
|
TestCutUrl.IsEnabled = true; |
|
|
|
|
DeviceCode.IsEnabled = true; |
|
|
|
|
// DeviceCode.IsEnabled = true; |
|
|
|
|
DefaultPassword.IsEnabled = true; |
|
|
|
|
DefaultUserName.IsEnabled = true; |
|
|
|
|
BrowseInstallPath.IsEnabled = true; |
|
|
|
@ -263,12 +264,12 @@ public partial class InstallWindow : Window |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string strDeviceCode = DeviceCode.Text; |
|
|
|
|
if (strDeviceCode.Length < 4) |
|
|
|
|
{ |
|
|
|
|
MessageBox.Show("设备号长度至少4位!"); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
// string strDeviceCode = DeviceCode.Text; |
|
|
|
|
// if (strDeviceCode.Length < 4) |
|
|
|
|
// { |
|
|
|
|
// MessageBox.Show("设备号长度至少4位!"); |
|
|
|
|
// return false; |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
string strCutUrl = CutUrl.Text; |
|
|
|
|
if (string.IsNullOrWhiteSpace(strCutUrl)) |
|
|
|
@ -324,6 +325,10 @@ public partial class InstallWindow : Window |
|
|
|
|
case "BrowseInstallPath": |
|
|
|
|
SetInstallPath(); |
|
|
|
|
break; |
|
|
|
|
case "CopyComputerCode": |
|
|
|
|
Clipboard.SetText(ComputerCode.Text); |
|
|
|
|
MessageBox.Show("已复制"); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -373,5 +378,11 @@ public partial class InstallWindow : Window |
|
|
|
|
MessageBox.Show("建议以管理员权限运行此程序!", "权限不足", MessageBoxButton.OK, MessageBoxImage.Warning); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string cpuInfo = Common.GetHardwareInfo("Win32_Processor", "ProcessorId"); |
|
|
|
|
string motherboardInfo = Common.GetHardwareInfo("Win32_BaseBoard", "SerialNumber"); |
|
|
|
|
string diskInfo =Common. GetHardwareInfo("Win32_DiskDrive", "SerialNumber"); |
|
|
|
|
|
|
|
|
|
ComputerCode.Text = Common.GenerateMd5Hash(cpuInfo+motherboardInfo+diskInfo); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |