Upgrade to v2.4

Add Long-Term Offline KMS (LTOK) mode (keep activating 19 years).
Add Japanese language.
Support for Windows 10 LTSC 2019 (Use LTOK mode).
Support for Windows Server 2016 and 2019 (Use LTOK mode).
Support for Windows 10 other edition (Use LTOK mode).
Fix issue for crash at certain conditions.
Improve performance.
Fix more bug.
This commit is contained in:
TGSAN 2018-12-06 21:44:50 +08:00
parent 47a02926b5
commit ce21e6484b
13 changed files with 217 additions and 85 deletions

View File

@ -65,12 +65,12 @@
<HintPath>..\packages\MaterialDesignColors.1.1.3\lib\net45\MaterialDesignColors.dll</HintPath> <HintPath>..\packages\MaterialDesignColors.1.1.3\lib\net45\MaterialDesignColors.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="MaterialDesignThemes.Wpf, Version=2.4.0.1044, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="MaterialDesignThemes.Wpf, Version=2.5.0.1205, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignThemes.2.4.0.1044\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath> <HintPath>..\packages\MaterialDesignThemes.2.5.0.1205\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
<Private>False</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
@ -103,6 +103,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Lang\ja.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Lang\zh.xaml"> <Page Include="Lang\zh.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -180,5 +184,8 @@
<ItemGroup> <ItemGroup>
<Folder Include="bin\Debug\" /> <Folder Include="bin\Debug\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Res\gatherosstateltsc.exe" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

View File

@ -1,5 +1,9 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!--
Version: 2.4.0.0
-->
<!--FontFamily Dictionary--> <!--FontFamily Dictionary-->
<FontFamily x:Key="Font"> <FontFamily x:Key="Font">
@ -87,7 +91,7 @@
Unable to correctly identify your operating system edition in support list, may be not be supported. Unable to correctly identify your operating system edition in support list, may be not be supported.
</sys:String> </sys:String>
<sys:String x:Key="Only_find_experimental"> <sys:String x:Key="Only_find_experimental">
Only find experimental options that can be used with this operating system edition, little hope of activation success. Only found experimental options that can be used with this operating system edition, little hope of activation success.
</sys:String> </sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_try"> <sys:String x:Key="notify_May_be_not_be_supported_try">
Your system edition may not be supported, program will exit. you can try add --expact or -e to startup. Your system edition may not be supported, program will exit. you can try add --expact or -e to startup.
@ -200,4 +204,10 @@ Time out, may be you choose or enter a incorrect version. :(
<sys:String x:Key="ErrorMsg-4" xml:space="preserve"> <sys:String x:Key="ErrorMsg-4" xml:space="preserve">
Activation Failed. :( &#10;Maybe: &#10;1.This edition/version of Windows does not support digital license activation. &#10;2. Unable to connect to Microsoft Windows Activation Server. &#10;3. Other unexpected problems. &#10;&#10;You can try to wait a minute or try again later. &#10; Activation Failed. :( &#10;Maybe: &#10;1.This edition/version of Windows does not support digital license activation. &#10;2. Unable to connect to Microsoft Windows Activation Server. &#10;3. Other unexpected problems. &#10;&#10;You can try to wait a minute or try again later. &#10;
</sys:String> </sys:String>
<sys:String x:Key="Only_find_ltok" xml:space="preserve">
Only found Long-Term Offline KMS (LTOK) options that can be used with this operating system edition. &#10;This means that it will not be activate automatically after you reinstalled the system. &#10;But don't worry, this is different from the legacy KMS activation method (it can keep activating for 180 days in offline environment). &#10;LTOK (The prefix is Offline-KMS) can keep activating for up to 19 years even it is without networking!
</sys:String>
<sys:String x:Key="DonateTextWillActivated" xml:space="preserve">
Congratulation! &#10;&#10;Windows 10 is ready to activate. &#10;However, it seems that Windows cannot connect to the Microsoft Activation Server.&#10;Your system will be activated automatically the next time the server is connected.
</sys:String>
</ResourceDictionary> </ResourceDictionary>

View File

@ -1,5 +1,9 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!--
Version: 2.3.0.1
-->
<!--FontFamily Dictionary--> <!--FontFamily Dictionary-->
<FontFamily x:Key="Font"> <FontFamily x:Key="Font">
@ -200,4 +204,10 @@ Windows10ライセンス認証にはインターネットを通じてキーを
<sys:String x:Key="ErrorMsg-4" xml:space="preserve"> <sys:String x:Key="ErrorMsg-4" xml:space="preserve">
認証失敗。 :( &#10;多分: &#10;1. このエディション/バージョンの Windows はデジタルライセンス認証が適用しない。 &#10;2. マイクロソフトの認証サーバーに接続できません。 &#10;3. その他。 &#10;&#10;暫くお待ちくださいまたはあとでもう一度やり直してください。 &#10; 認証失敗。 :( &#10;多分: &#10;1. このエディション/バージョンの Windows はデジタルライセンス認証が適用しない。 &#10;2. マイクロソフトの認証サーバーに接続できません。 &#10;3. その他。 &#10;&#10;暫くお待ちくださいまたはあとでもう一度やり直してください。 &#10;
</sys:String> </sys:String>
<sys:String x:Key="Only_find_ltok" xml:space="preserve">
Only found Long-Term Offline KMS (LTOK) options that can be used with this operating system edition. &#10;This means that it will not be activate automatically after you reinstalled the system. &#10;But don't worry, this is different from the legacy KMS activation method (it can keep activating for 180 days in offline environment). &#10;LTOK (The prefix is Offline-KMS) can keep activating for up to 19 years even it is without networking!
</sys:String>
<sys:String x:Key="DonateTextWillActivated" xml:space="preserve">
Congratulation! &#10;&#10;Windows 10 is ready to activate. &#10;However, it seems that Windows cannot connect to the Microsoft Activation Server.&#10;Your system will be activated automatically the next time the server is connected.
</sys:String>
</ResourceDictionary> </ResourceDictionary>

View File

@ -1,13 +1,17 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!--
Version: 2.4.0.0
-->
<!--FontFamily Dictionary--> <!--FontFamily Dictionary-->
<FontFamily x:Key="Font"> <FontFamily x:Key="Font">
Microsoft YaHei UI Microsoft YaHei UI
</FontFamily> </FontFamily>
<!--String Dictionary--> <!--String Dictionary-->
<sys:String x:Key="OK"> <sys:String x:Key="OK">
</sys:String> </sys:String>
@ -200,4 +204,10 @@
<sys:String x:Key="ErrorMsg-4" xml:space="preserve"> <sys:String x:Key="ErrorMsg-4" xml:space="preserve">
激活失败。 :( &#10;可能因为: &#10;1. 此版本/类型的 Windows 不支持数字权利(数字许可证)方式激活。 &#10;2. 无法连接到微软Windows激活服务器。 &#10;3. 其它未知问题。 &#10;&#10;你可以尝试稍等片刻或者稍后重试。 &#10; 激活失败。 :( &#10;可能因为: &#10;1. 此版本/类型的 Windows 不支持数字权利(数字许可证)方式激活。 &#10;2. 无法连接到微软Windows激活服务器。 &#10;3. 其它未知问题。 &#10;&#10;你可以尝试稍等片刻或者稍后重试。 &#10;
</sys:String> </sys:String>
<sys:String x:Key="Only_find_ltok" xml:space="preserve">
只找到用于此版本系统的长期离线KMS批量激活选项。&#10;这表示您将不能在下次重装系统后自动激活。&#10;不过无需担心这不同于传统的KMS激活方式离线状态下可以保持激活180天&#10;长期离线KMSOffline-KMS即使不联网也可以保持激活长达19年
</sys:String>
<sys:String x:Key="DonateTextWillActivated" xml:space="preserve">
祝贺! &#10;&#10;Windows 10 已经快要激活成功了。&#10;不过似乎Windows无法连接到微软激活服务器&#10;当下次连接上服务器时系统将会自动激活。
</sys:String>
</ResourceDictionary> </ResourceDictionary>

View File

@ -12,7 +12,7 @@
TextElement.FontWeight="Regular" TextElement.FontWeight="Regular"
TextElement.FontSize="13" TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal" TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto" TextOptions.TextRenderingMode="Aliased"
Background="{DynamicResource MaterialDesignPaper}" Background="{DynamicResource MaterialDesignPaper}"
ResizeMode="NoResize" ResizeMode="NoResize"
d:DataContext="{d:DesignInstance domain:ViewModel, d:IsDesignTimeCreatable=False}" d:DataContext="{d:DesignInstance domain:ViewModel, d:IsDesignTimeCreatable=False}"
@ -22,34 +22,36 @@
> >
<!--FontFamily="{DynamicResource MaterialDesignFont}"--> <!--FontFamily="{DynamicResource MaterialDesignFont}"-->
<Grid> <Grid>
<StackPanel> <Grid Margin="30,30,30,30" VerticalAlignment="Center">
<materialDesign:Card Padding="32" Margin="15,15,15,0"> <StackPanel>
<TextBlock FontSize="20" ><Run Text="{DynamicResource AppName}"/></TextBlock> <materialDesign:Card Padding="30" Margin="0,0,0,0">
</materialDesign:Card> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" ><Run Text="{DynamicResource AppName}"/></TextBlock>
<materialDesign:Card Padding="32" Margin="15,15,15,0"> </materialDesign:Card>
<StackPanel> <materialDesign:Card Padding="30,30" Margin="0,30,0,0">
<Grid> <StackPanel>
<ComboBox x:Name="SystemEditionText" DisplayMemberPath="DisplayOS" VerticalAlignment="Center" Visibility="Visible"/> <Grid>
<TextBox x:Name="SystemEditionTextInput" materialDesign:HintAssist.Hint="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" MaxLength="29" xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore" input:InputMethod.IsInputMethodEnabled="False" VerticalAlignment="Center" Visibility="Hidden" TextChanged="SystemEditionTextInput_TextChanged"> <ComboBox x:Name="SystemEditionText" DisplayMemberPath="DisplayOS" VerticalAlignment="Center" Visibility="Visible"/>
<TextBox.Text> <TextBox x:Name="SystemEditionTextInput" materialDesign:HintAssist.Hint="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" MaxLength="29" xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore" input:InputMethod.IsInputMethodEnabled="False" VerticalAlignment="Center" Visibility="Hidden" TextChanged="SystemEditionTextInput_TextChanged">
<Binding Path="SN" UpdateSourceTrigger="PropertyChanged"> <TextBox.Text>
<Binding.ValidationRules> <Binding Path="SN" UpdateSourceTrigger="PropertyChanged">
<domain:IsSN ValidatesOnTargetUpdated="True"/> <Binding.ValidationRules>
</Binding.ValidationRules> <domain:IsSN ValidatesOnTargetUpdated="True"/>
</Binding> </Binding.ValidationRules>
</TextBox.Text> </Binding>
</TextBox> </TextBox.Text>
</Grid> </TextBox>
<!--<TextBlock x:Name="SystemEditionText" Text="Checking System" />--> </Grid>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,30,0,0"> <!--<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="SystemEditionText" Text="Checking System" />-->
<RadioButton x:Name="AutoRadio" Content="{DynamicResource Auto_Mode}" Margin="30,0,30,0" IsChecked="True" Checked="A_RadioButton_Checked"/> <StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,30,0,0">
<RadioButton x:Name="ManualRadio" Content="{DynamicResource Manual_Mode}" Margin="30,0,30,0" Checked="M_RadioButton_Checked"/> <RadioButton x:Name="AutoRadio" Content="{DynamicResource Auto_Mode}" Margin="30,0,30,0" IsChecked="True" Checked="A_RadioButton_Checked"/>
<RadioButton x:Name="ManualRadio" Content="{DynamicResource Manual_Mode}" Margin="30,0,30,0" Checked="M_RadioButton_Checked"/>
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </materialDesign:Card>
</materialDesign:Card> <Button FontFamily="{DynamicResource Font}" x:Name="actbtn" Content="{DynamicResource Activate_Button}" Margin="0,30,0,0" VerticalAlignment="Top" Click="Activate_Button_Click" Height="65"/>
<Button FontFamily="{DynamicResource Font}" x:Name="actbtn" Content="{DynamicResource Activate_Button}" Margin="30,30,30,0" VerticalAlignment="Top" Click="Activate_Button_Click" Height="65"/> <Button FontFamily="{DynamicResource Font}" x:Name="installbtn" Content="{DynamicResource Convert_versions}" Margin="0,30,0,0" VerticalAlignment="Top" Click="installbtn_Click" Height="65"/>
<Button FontFamily="{DynamicResource Font}" x:Name="installbtn" Content="{DynamicResource Convert_versions}" Margin="30,30,30,0" VerticalAlignment="Top" Click="installbtn_Click" Height="65"/> </StackPanel>
</StackPanel> </Grid>
<Grid x:Name="DialogHostGrid" Visibility="Hidden"> <Grid x:Name="DialogHostGrid" Visibility="Hidden">
<materialDesign:DialogHost x:Name="DialogWait" IsOpen="False"> <materialDesign:DialogHost x:Name="DialogWait" IsOpen="False">
<materialDesign:DialogHost.DialogContent> <materialDesign:DialogHost.DialogContent>
@ -58,7 +60,7 @@
<StackPanel> <StackPanel>
<StackPanel Margin="32,24,32,24"> <StackPanel Margin="32,24,32,24">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" /> <ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
<TextBlock Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" /> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</materialDesign:Card> </materialDesign:Card>
@ -72,7 +74,7 @@
<StackPanel> <StackPanel>
<StackPanel Margin="32,24,32,24"> <StackPanel Margin="32,24,32,24">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" /> <ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
<TextBlock x:Name="activatingtext" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Activating}" /> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="activatingtext" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Activating}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</materialDesign:Card> </materialDesign:Card>
@ -86,7 +88,7 @@
<StackPanel> <StackPanel>
<StackPanel Margin="24,24,24,8"> <StackPanel Margin="24,24,24,8">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" /> <ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
<TextBlock Margin="24,16,24,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" /> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="24,16,24,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" />
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8"> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
@ -106,8 +108,8 @@
<StackPanel> <StackPanel>
<StackPanel Margin="16,16,16,8"> <StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />--> <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Title" /> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Title" />
<TextBlock Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="Hello World" /> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="Hello World" />
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8"> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
@ -127,8 +129,8 @@
<StackPanel> <StackPanel>
<StackPanel Margin="16,16,16,8"> <StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />--> <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Help"></TextBlock> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Help"></TextBlock>
<TextBlock Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource HelpText}"></TextBlock> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource HelpText}"></TextBlock>
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8"> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
@ -148,8 +150,8 @@
<StackPanel> <StackPanel>
<StackPanel Margin="16,16,16,8"> <StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />--> <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock x:Name="DialogWithExitTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource ErrorTitle}"/> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="DialogWithExitTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource ErrorTitle}"/>
<TextBlock x:Name="DialogWithExitText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Disconnect_to_server_exit}"/> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="DialogWithExitText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Disconnect_to_server_exit}"/>
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8"> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
@ -168,8 +170,8 @@
<StackPanel> <StackPanel>
<StackPanel Margin="16,16,16,8"> <StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />--> <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock x:Name="DialogWithOKToCloseDialogTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="DialogWithOKToCloseDialogTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
<TextBlock x:Name="DialogWithOKToCloseDialogText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Text</TextBlock> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="DialogWithOKToCloseDialogText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Text</TextBlock>
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8"> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
@ -188,8 +190,8 @@
<StackPanel> <StackPanel>
<StackPanel Margin="16,16,16,8"> <StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />--> <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock x:Name="DialogWithOKToCloseDialogDonateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource Complete}" /> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="DialogWithOKToCloseDialogDonateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource Complete}" />
<TextBlock x:Name="DialogWithOKToCloseDialogDonateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource DonateTextActivated}" /> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="DialogWithOKToCloseDialogDonateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource DonateTextActivated}" />
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8"> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
@ -209,8 +211,8 @@
<StackPanel> <StackPanel>
<StackPanel Margin="16,16,16,8"> <StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />--> <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock x:Name="DialogUpdateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource UpdateTitle}" /> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="DialogUpdateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource UpdateTitle}" />
<TextBlock x:Name="DialogUpdateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource UpdateText}" /> <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="DialogUpdateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource UpdateText}" />
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8"> <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button x:Name="IgnoreUpdate" FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" <Button x:Name="IgnoreUpdate" FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"

View File

@ -89,6 +89,7 @@ namespace CMWTAT_DIGITAL
public void ExportTempFile() public void ExportTempFile()
{ {
//string tempfile = System.IO.Path.GetTempPath() + @"CMWTAT_DIGITAL\"; //string tempfile = System.IO.Path.GetTempPath() + @"CMWTAT_DIGITAL\";
//if (tempfile.EndsWith(@"\")) //if (tempfile.EndsWith(@"\"))
@ -96,7 +97,10 @@ namespace CMWTAT_DIGITAL
// tempfile = tempfile.Remove(tempfile.Length - 1, 1); // tempfile = tempfile.Remove(tempfile.Length - 1, 1);
//} //}
if (!Directory.Exists(tempfile)) if (Directory.Exists(tempfile))
{
DelectTempFile();
} else
{ {
Directory.CreateDirectory(tempfile); Directory.CreateDirectory(tempfile);
} }
@ -109,6 +113,11 @@ namespace CMWTAT_DIGITAL
fileStream.Write(temp, 0, (int)(temp.Length)); fileStream.Write(temp, 0, (int)(temp.Length));
fileStream.Close(); fileStream.Close();
temp = CMWTAT_DIGITAL.Properties.Resources.gatherosstateltsc;
fileStream = new System.IO.FileStream(tempfile + "gatherosstateltsc" + ".exe", System.IO.FileMode.CreateNew);
fileStream.Write(temp, 0, (int)(temp.Length));
fileStream.Close();
temp = CMWTAT_DIGITAL.Properties.Resources.slc; temp = CMWTAT_DIGITAL.Properties.Resources.slc;
fileStream = new System.IO.FileStream(tempfile + "slc" + ".dll", System.IO.FileMode.CreateNew); fileStream = new System.IO.FileStream(tempfile + "slc" + ".dll", System.IO.FileMode.CreateNew);
fileStream.Write(temp, 0, (int)(temp.Length)); fileStream.Write(temp, 0, (int)(temp.Length));
@ -388,7 +397,7 @@ namespace CMWTAT_DIGITAL
private void LoadOSList() private void LoadOSList()
{ {
int is_selected = 0; //是否已经自动选择,0未选择1普通模式2实验模式 int is_selected = 0; //是否已经自动选择,0未选择1普通模式2实验模式3离线KMS模式
actbtn.Dispatcher.Invoke(new Action(() => actbtn.Dispatcher.Invoke(new Action(() =>
{ {
@ -400,14 +409,14 @@ namespace CMWTAT_DIGITAL
string json; string json;
try try
{ {
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=1&ver=2"); // 主要服务器 json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=1&ver=3"); // 主要服务器
} }
catch (Exception e) catch (Exception e)
{ {
Console.WriteLine("MainServer:" + MainServerDomain + " is not working."); Console.WriteLine("MainServer:" + MainServerDomain + " is not working.");
Console.WriteLine("Error Message:" + e.Message); Console.WriteLine("Error Message:" + e.Message);
Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain); Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain);
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=1&ver=2"); // 备用服务器 json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=1&ver=3"); // 备用服务器
} }
JObject jsonobj = JObject.Parse(json); JObject jsonobj = JObject.Parse(json);
List<Frequency> list = new List<Frequency>(); List<Frequency> list = new List<Frequency>();
@ -420,6 +429,7 @@ namespace CMWTAT_DIGITAL
freq.DisplayOS = jsonobj["OS"][i].ToString(); freq.DisplayOS = jsonobj["OS"][i].ToString();
//按照优先级判断,如果已经自动选择则忽略新的 //按照优先级判断,如果已经自动选择则忽略新的
//选择带版本号
if (String.Equals(jsonobj["OS"][i].ToString(), SystemEdition + OSVersionInfo.BuildVersion, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//jsonobj["OS"][i].ToString() == SystemEdition + OSVersionInfo.BuildVersion if (String.Equals(jsonobj["OS"][i].ToString(), SystemEdition + OSVersionInfo.BuildVersion, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//jsonobj["OS"][i].ToString() == SystemEdition + OSVersionInfo.BuildVersion
{ {
now_os_index = i; now_os_index = i;
@ -427,6 +437,15 @@ namespace CMWTAT_DIGITAL
is_selected = 1; is_selected = 1;
} }
//选择带版本号Offline-KMS
if (String.Equals(jsonobj["OS"][i].ToString(), "(Offline-KMS) " + SystemEdition + OSVersionInfo.BuildVersion, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition新方法忽略大小写并提升效率
{
now_os_index = i;
checked_os = "(Offline-KMS) " + SystemEdition + OSVersionInfo.BuildVersion;
is_selected = 3;
}
//选择不带版本号
if (String.Equals(jsonobj["OS"][i].ToString(), SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//jsonobj["OS"][i].ToString() == SystemEdition if (String.Equals(jsonobj["OS"][i].ToString(), SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//jsonobj["OS"][i].ToString() == SystemEdition
{ {
now_os_index = i; now_os_index = i;
@ -434,6 +453,15 @@ namespace CMWTAT_DIGITAL
is_selected = 1; is_selected = 1;
} }
//选择不带版本号Offline-KMS
if (String.Equals(jsonobj["OS"][i].ToString(), "(Offline-KMS) " + SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition新方法忽略大小写并提升效率
{
now_os_index = i;
checked_os = "(Offline-KMS) " + SystemEdition;
is_selected = 3;
}
//选择不带版本号实验
if (String.Equals(jsonobj["OS"][i].ToString(), "(Experimental) " + SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition新方法忽略大小写并提升效率 if (String.Equals(jsonobj["OS"][i].ToString(), "(Experimental) " + SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition新方法忽略大小写并提升效率
{ {
now_os_index = i; now_os_index = i;
@ -456,11 +484,18 @@ namespace CMWTAT_DIGITAL
} }
else if (is_selected == 2)//只找到实验性 else if (is_selected == 2)//只找到实验性
{ {
this.SystemEditionText.SelectedIndex = 0; this.SystemEditionText.SelectedIndex = now_os_index;
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["Attention"]; this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["Attention"];
this.DialogWithOKToCloseDialogText.Text = (string)this.Resources["Only_find_experimental"] + "\r\n(" + (string)this.Resources["System_Edition"] + ": " + SystemEdition + OSVersionInfo.BuildVersion + ")"; this.DialogWithOKToCloseDialogText.Text = (string)this.Resources["Only_find_experimental"] + "\r\n(" + (string)this.Resources["System_Edition"] + ": " + SystemEdition + OSVersionInfo.BuildVersion + ")";
this.DialogWithOKToCloseDialog.IsOpen = true; this.DialogWithOKToCloseDialog.IsOpen = true;
} }
else if (is_selected == 3)//只找到长期KMS
{
this.SystemEditionText.SelectedIndex = now_os_index;
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["Attention"];
this.DialogWithOKToCloseDialogText.Text = (string)this.Resources["Only_find_ltok"] + "\r\n(" + (string)this.Resources["System_Edition"] + ": " + SystemEdition + OSVersionInfo.BuildVersion + ")";
this.DialogWithOKToCloseDialog.IsOpen = true;
}
else else
{ {
this.SystemEditionText.SelectedIndex = now_os_index; this.SystemEditionText.SelectedIndex = now_os_index;
@ -654,14 +689,14 @@ namespace CMWTAT_DIGITAL
string json; string json;
try try
{ {
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=2"); // 主要服务器 json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=3"); // 主要服务器
} }
catch (Exception e) catch (Exception e)
{ {
Console.WriteLine("MainServer:" + MainServerDomain + " is not working."); Console.WriteLine("MainServer:" + MainServerDomain + " is not working.");
Console.WriteLine("Error Message:" + e.Message); Console.WriteLine("Error Message:" + e.Message);
Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain); Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain);
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=2"); // 备用服务器 json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=3"); // 备用服务器
} }
JObject jsonobj = JObject.Parse(json); JObject jsonobj = JObject.Parse(json);
List<Frequency> list = new List<Frequency>(); List<Frequency> list = new List<Frequency>();
@ -722,8 +757,8 @@ namespace CMWTAT_DIGITAL
code = "-1"; code = "-1";
msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :("; msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
} }
//string runend = RunCScript(slmgr_self, "-upk").Trim(); //string runend = RunCScript(slmgr_self, "-upk").Trim();
EndLine:; EndLine:;
if (code != "200") if (code != "200")
{ {
actbtn.Dispatcher.Invoke(new Action(() => actbtn.Dispatcher.Invoke(new Action(() =>
@ -769,6 +804,7 @@ namespace CMWTAT_DIGITAL
private void RunAct() private void RunAct()
{ {
bool is_not_network_to_act = false; //是否无法联网稍后激活
ExportTempFile(); ExportTempFile();
//释放文件 //释放文件
actbtn.Dispatcher.Invoke(new Action(() => actbtn.Dispatcher.Invoke(new Action(() =>
@ -785,7 +821,7 @@ namespace CMWTAT_DIGITAL
string sku = "0"; string sku = "0";
string msg = "Unknow Error!"; string msg = "Unknow Error!";
string system = ""; string system = "";
string mode = "1"; //1普通SYS、SKU、KEY完全2.需要获取SKUSYS、KEY3.手动输入KEY string mode = "1"; //1普通SYS、SKU、KEY完全2.需要获取SKUSYS、KEY3.手动输入KEY4.普通OfflineKMSSYS、SKU、KEY完全
string slmgr = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86) + "\\slmgr.vbs"; string slmgr = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86) + "\\slmgr.vbs";
@ -817,14 +853,14 @@ namespace CMWTAT_DIGITAL
string json; string json;
try try
{ {
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=2"); // 主要服务器 json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=3"); // 主要服务器
} }
catch (Exception e) catch (Exception e)
{ {
Console.WriteLine("MainServer:" + MainServerDomain + " is not working."); Console.WriteLine("MainServer:" + MainServerDomain + " is not working.");
Console.WriteLine("Error Message:" + e.Message); Console.WriteLine("Error Message:" + e.Message);
Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain); Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain);
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=2"); // 备用服务器 json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=3"); // 备用服务器
} }
JObject jsonobj = JObject.Parse(json); JObject jsonobj = JObject.Parse(json);
List<Frequency> list = new List<Frequency>(); List<Frequency> list = new List<Frequency>();
@ -833,6 +869,21 @@ namespace CMWTAT_DIGITAL
sku = jsonobj[system]["sku"].ToString(); sku = jsonobj[system]["sku"].ToString();
Console.WriteLine("Edition:" + system + "\r\nKEY:" + key + "\r\nSKU:" + sku); Console.WriteLine("Edition:" + system + "\r\nKEY:" + key + "\r\nSKU:" + sku);
string selecos = "";
// 获取当前选择的选择的文本
actbtn.Dispatcher.Invoke(new Action(() =>
{
selecos = SystemEditionText.Text;
}));
Console.WriteLine("Selected OS: " + selecos);
if (selecos.ToUpper().StartsWith("(Offline-KMS)".ToUpper()))
{
Console.WriteLine("Switch Mode Offline-KMS");
mode = "4";
}
if (sku == "unknow") if (sku == "unknow")
{ {
mode = "2"; mode = "2";
@ -855,6 +906,7 @@ namespace CMWTAT_DIGITAL
key = this.SystemEditionTextInput.Text; key = this.SystemEditionTextInput.Text;
})); }));
mode = "3"; mode = "3";
sku = "unknow";
} }
@ -872,7 +924,7 @@ namespace CMWTAT_DIGITAL
RunCScript(slmgr_self, "-ckms").Trim(); RunCScript(slmgr_self, "-ckms").Trim();
if (mode == "2" || mode == "3") if (sku == "unknow")//if (mode == "2" || mode == "3") //获取SKU
{ {
actbtn.Dispatcher.Invoke(new Action(() => actbtn.Dispatcher.Invoke(new Action(() =>
@ -932,7 +984,19 @@ namespace CMWTAT_DIGITAL
ShowBallSameDig(); ShowBallSameDig();
})); }));
RunCMD(@"reg add ""HKLM\SYSTEM\Tokens"" /v ""Channel"" /t REG_SZ /d ""Retail"" /f"); if (mode == "4")
{
//长期KMS
Console.WriteLine(RunCScript(slmgr_self, "-skms 0.0.0.0").Trim());
//if (runend.EndsWith("successfully."))
//{
//}
RunCMD(@"reg add ""HKLM\SYSTEM\Tokens"" /v ""Channel"" /t REG_SZ /d ""Volume:GVLK"" /f");
}
else
{
RunCMD(@"reg add ""HKLM\SYSTEM\Tokens"" /v ""Channel"" /t REG_SZ /d ""Retail"" /f");
}
RunCMD(@"reg add ""HKLM\SYSTEM\Tokens\Kernel"" /v ""Kernel-ProductInfo"" /t REG_DWORD /d " + sku + " /f"); RunCMD(@"reg add ""HKLM\SYSTEM\Tokens\Kernel"" /v ""Kernel-ProductInfo"" /t REG_DWORD /d " + sku + " /f");
RunCMD(@"reg add ""HKLM\SYSTEM\Tokens\Kernel"" /v ""Security-SPP-GenuineLocalStatus"" /t REG_DWORD /d 1 /f"); RunCMD(@"reg add ""HKLM\SYSTEM\Tokens\Kernel"" /v ""Security-SPP-GenuineLocalStatus"" /t REG_DWORD /d 1 /f");
RunCMD(@"reg add ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"" /v ""C:\gatherosstate.exe"" /d ""~ WIN7RTM"" /f"); RunCMD(@"reg add ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"" /v ""C:\gatherosstate.exe"" /d ""~ WIN7RTM"" /f");
@ -956,7 +1020,15 @@ namespace CMWTAT_DIGITAL
ShowBallSameDig(); ShowBallSameDig();
})); }));
RunCMD(tempfile + "gatherosstate.exe"); if (mode == "4")
{
//长期KMS
RunCMD(tempfile + "gatherosstateltsc.exe");
}
else
{
RunCMD(tempfile + "gatherosstate.exe");
}
//旧的位置 //旧的位置
//RunCMD(System.AppDomain.CurrentDomain.BaseDirectory + "gatherosstate.exe"); tempfile //RunCMD(System.AppDomain.CurrentDomain.BaseDirectory + "gatherosstate.exe"); tempfile
@ -995,8 +1067,12 @@ namespace CMWTAT_DIGITAL
runend = RunCScript(slmgr_self, "-ato").Trim(); runend = RunCScript(slmgr_self, "-ato").Trim();
Console.WriteLine(runend); Console.WriteLine(runend);
if (runend.EndsWith("060' to display the error text.") || runend.EndsWith("successfully.") || runend.EndsWith("to display the error text.")) if (runend.EndsWith("successfully.") || runend.Contains("0xC004F074") || runend.Contains("0xC004C003")) //0xC004F074是KMS19年长期激活会出的提示Error 0xC004C003: The activation server determined that the specified product key is blocked. 是因为未连接激活服务器,下次连接时会自动激活。
{ {
if (runend.Contains("0xC004C003"))
{
is_not_network_to_act = true;
}
code = "200"; code = "200";
} }
else else
@ -1022,8 +1098,8 @@ namespace CMWTAT_DIGITAL
code = "-1"; code = "-1";
msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :("; msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
} }
//string runend = RunCScript(slmgr_self, "-upk").Trim(); //string runend = RunCScript(slmgr_self, "-upk").Trim();
EndLine:; EndLine:;
if (code != "200") if (code != "200")
{ {
actbtn.Dispatcher.Invoke(new Action(() => actbtn.Dispatcher.Invoke(new Action(() =>
@ -1053,7 +1129,15 @@ namespace CMWTAT_DIGITAL
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中 this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
this.DialogWithOKToCloseDialogDonate.IsOpen = true; this.DialogWithOKToCloseDialogDonate.IsOpen = true;
this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题 this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextActivated"]; //完成转换内容 if (is_not_network_to_act == true)
{
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextWillActivated"]; //即将激活内容
}
else
{
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextActivated"]; //完成激活内容
}
if (hiderun == true && autoact == true) if (hiderun == true && autoact == true)
{ {
int tipShowMilliseconds = 0; int tipShowMilliseconds = 0;

View File

@ -33,6 +33,8 @@ namespace CMWTAT_DIGITAL
new AssemblyName(args.Name).Name + ".dll"; new AssemblyName(args.Name).Name + ".dll";
Console.WriteLine("Load Assembly: " + resourceName);
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
{ {
Byte[] assemblyData = new Byte[stream.Length]; Byte[] assemblyData = new Byte[stream.Length];
@ -43,12 +45,6 @@ namespace CMWTAT_DIGITAL
} }
}; };
//if (startup_args.Length == 0)
//{
// //MessageBox.Show("ARGS NULL");
// //Console.WriteLine("CMWTAT Digital Edition V2");
// //Console.WriteLine("This application can use console args.");
//}
foreach (string arg in startup_args) foreach (string arg in startup_args)
{ {
Console.WriteLine("arg: " + arg); Console.WriteLine("arg: " + arg);

View File

@ -51,5 +51,5 @@ using System.Windows;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: : // 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.0.0")] [assembly: AssemblyVersion("2.4.0.0")]
[assembly: AssemblyFileVersion("2.3.0.0")] [assembly: AssemblyFileVersion("2.4.0.0")]

View File

@ -47,7 +47,7 @@ namespace CMWTAT_DIGITAL.Properties {
} }
/// <summary> /// <summary>
/// 使用此强类型资源类,为所有资源查找 /// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。 /// 重写当前线程的 CurrentUICulture 属性。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
@ -80,6 +80,16 @@ namespace CMWTAT_DIGITAL.Properties {
} }
} }
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] gatherosstateltsc {
get {
object obj = ResourceManager.GetObject("gatherosstateltsc", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary> /// <summary>
/// 查找 System.Byte[] 类型的本地化资源。 /// 查找 System.Byte[] 类型的本地化资源。
/// </summary> /// </summary>

View File

@ -124,6 +124,9 @@
<data name="gatherosstate" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="gatherosstate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Res\gatherosstate.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Res\gatherosstate.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="gatherosstateltsc" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Res\gatherosstateltsc.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="slc" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="slc" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Res\slc.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Res\slc.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="MaterialDesignColors" version="1.1.3" targetFramework="net45" /> <package id="MaterialDesignColors" version="1.1.3" targetFramework="net45" />
<package id="MaterialDesignThemes" version="2.4.0.1044" targetFramework="net45" /> <package id="MaterialDesignThemes" version="2.5.0.1205" targetFramework="net452" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net452" />
</packages> </packages>

Binary file not shown.