Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
4.4.1.2 更新
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceTimee committed Apr 5, 2022
1 parent 8eec473 commit 70685a1
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 89 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
<h3 align="center">- Vizpower Plugin Installer -</h3>
</br>

## 下载地址:
Github: [https://github.com/SpaceTimee/Vizpower-Plugin-Installer/releases](https://github.com/SpaceTimee/Vizpower-Plugin-Installer/releases)
## 自我介绍
**Vizpower Plugin Installer**: 一只基于 **WPF** 的无限宝第三方插件安装器
* 适用平台: Windows

## 联系邮箱:
**Zeus6_6@163.com**
## 下载地址
Github: [https://github.com/SpaceTimee/Vizpower-Plugin-Installer/releases](https://github.com/SpaceTimee/Vizpower-Plugin-Installer/releases)

## 反馈群号:
## 反馈群号
❤: 904645614</br>
💛: 909457621</br>
💙: 705468445

## 开发者:
## 联系邮箱
**Zeus6_6@163.com**

## 开发者
**快乐小牛, WXRIW, Space Time**
3 changes: 1 addition & 2 deletions Vizpower Plugin Installer/App.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Application x:Class="Vizpower_Plugin_Installer_WPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
4 changes: 4 additions & 0 deletions Vizpower Plugin Installer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ namespace Vizpower_Plugin_Installer_WPF
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
new MainWindow(e.Args).Show();
}
}
}
78 changes: 32 additions & 46 deletions Vizpower Plugin Installer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

namespace Vizpower_Plugin_Installer_WPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
//说明:
Expand All @@ -37,7 +34,7 @@ public partial class MainWindow : Window
private const string InstallTipUrl = @"https://gitee.com/klxn/wxbplugin/raw/master/install.png"; //安装提示Url
private const string InstallVideoUrl = @"https://www.bilibili.com/video/BV1Ca4y1E7mx"; //使用教程Url

//注意:打包无需修改下方内容
//注意:打包请勿修改下方内容
private static readonly Version CurrentVersion = Assembly.GetExecutingAssembly().GetName().Version; //当前版本
private static readonly int CurrentVersionCode = int.Parse(CurrentVersion.Major.ToString() + CurrentVersion.Minor.ToString() + CurrentVersion.Build.ToString()); //当前版本号

Expand All @@ -46,7 +43,7 @@ public partial class MainWindow : Window
private static string WxbPluginGUIExePath = "";
private static string WxbPluginGUIDllPath = "";

public MainWindow()
public MainWindow(string[] args)
{
InitializeComponent();

Expand All @@ -55,26 +52,13 @@ public MainWindow()
Task.Run(CheckUpdateOnline);

//修改全局标题
Title = "无限宝第三方插件 Ver " + CurrentVersion.Major + "." + CurrentVersion.Minor + "." + CurrentVersion.Build + " " + SpecialVersion + " 安装器";
Title = "无限宝第三方插件 " + CurrentVersion.Major + "." + CurrentVersion.Minor + "." + CurrentVersion.Build + " " + SpecialVersion + (string.IsNullOrEmpty(SpecialVersion) ? "安装器" : " 安装器");

//恢复安装路径
if (File.Exists(Properties.Settings.Default.FilePath))
{
LocationTextBox.Text = Properties.Settings.Default.FilePath;
FileName = Properties.Settings.Default.FileName;
}

//处理恢复记录
if (LocationTextBox.Text != "" && FileName != "")
{
CaptureDesktopPath = LocationTextBox.Text.Replace(FileName, "CaptureDesktop.dll");
WxbPluginGUIExePath = LocationTextBox.Text.Replace(FileName, "WxbPluginGUI.exe");
WxbPluginGUIDllPath = LocationTextBox.Text.Replace(FileName, "wxbPluginGUI.dll");

if (File.Exists(CaptureDesktopPath) &&
File.Exists(WxbPluginGUIExePath))
InstallButton.Content = "更新";
}
//填充安装路径
if (args.Length >= 1 && File.Exists(args[0]) && Path.GetFileName(args[0]).StartsWith("LoginTool") && Path.GetFileName(args[0]).EndsWith(".exe"))
DealWithPath(args[0]);
else if (File.Exists(Properties.Settings.Default.FilePath))
DealWithPath(Properties.Settings.Default.FilePath);
}
private void CheckUpdateOnline()
{
Expand Down Expand Up @@ -150,7 +134,7 @@ private void CheckUpdateOnline()
private string GetWebCode(string strURL)
{
Uri arg_15_0 = new Uri(strURL);
byte[] i = new byte[1];
byte[] i;
Queue<byte> dataQue = new Queue<byte>();
HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(arg_15_0);
DateTime sTime = Conversions.ToDate("1990-09-21 00:00:00");
Expand Down Expand Up @@ -243,33 +227,35 @@ private object GetByDiv2(string code, string divBegin, string divEnd)
}
}

//安装拆卸核心功能
//安装路径
private void NavigateButton_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "无限宝登陆工具|LoginTool*.exe";
OpenFileDialog openFileDialog = new OpenFileDialog { Filter = "无限宝登陆工具|LoginTool*.exe" };

if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
LocationTextBox.Text = openFileDialog.FileName; //路径
FileName = System.IO.Path.GetFileName(LocationTextBox.Text); //文件名(包括后缀名)
DealWithPath(openFileDialog.FileName);
}
private void DealWithPath(string filePath)
{
LocationTextBox.Text = filePath; //路径
FileName = Path.GetFileName(filePath); //文件名(包括后缀名)

CaptureDesktopPath = LocationTextBox.Text.Replace(FileName, "CaptureDesktop.dll");
WxbPluginGUIExePath = LocationTextBox.Text.Replace(FileName, "WxbPluginGUI.exe");
WxbPluginGUIDllPath = LocationTextBox.Text.Replace(FileName, "wxbPluginGUI.dll");
CaptureDesktopPath = LocationTextBox.Text.Replace(FileName, "CaptureDesktop.dll");
WxbPluginGUIExePath = LocationTextBox.Text.Replace(FileName, "WxbPluginGUI.exe");
WxbPluginGUIDllPath = LocationTextBox.Text.Replace(FileName, "wxbPluginGUI.dll");

Properties.Settings.Default.FileName = FileName;
Properties.Settings.Default.FilePath = LocationTextBox.Text;
Properties.Settings.Default.Save();
Properties.Settings.Default.FilePath = LocationTextBox.Text;
Properties.Settings.Default.Save();

if (File.Exists(CaptureDesktopPath) &&
File.Exists(WxbPluginGUIExePath))
InstallButton.Content = "更新";
}
if (File.Exists(CaptureDesktopPath) &&
File.Exists(WxbPluginGUIExePath))
InstallButton.Content = "更新";
}

//安装拆卸
private void InstallButton_Click(object sender, EventArgs e)
{
if (LocationTextBox.Text == "" || FileName == "")
if (string.IsNullOrEmpty(LocationTextBox.Text) || string.IsNullOrEmpty(FileName))
{
MessageBox.Show("请点击浏览找到 LoginTool.exe 文件", Title, MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
Expand Down Expand Up @@ -310,7 +296,7 @@ private void InstallButton_Click(object sender, EventArgs e)
}
private void UninstallButton_Click(object sender, RoutedEventArgs e)
{
if (LocationTextBox.Text == "" || FileName == "")
if (string.IsNullOrEmpty(LocationTextBox.Text) || string.IsNullOrEmpty(FileName))
{
MessageBox.Show("请点击浏览找到 LoginTool.exe 文件", Title, MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
Expand Down Expand Up @@ -350,13 +336,13 @@ private void UninstallButton_Click(object sender, RoutedEventArgs e)
}
private bool KillWxbProcess()
{
if (MessageBox.Show("需要关闭无限宝相关进程,如有残留进程,安装器会关闭它,是否继续?", Title, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
return false;

foreach (Process process in Process.GetProcesses())
{
if (process.ProcessName == "iMeeting" || process.ProcessName == "LoginTool" || process.ProcessName == "WxbPluginGUI")
{
if (MessageBox.Show("发现无限宝相关进程残留,安装器会尝试自动关闭它,是否继续?", Title, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
return false;

try
{
process.Kill();
Expand Down
14 changes: 1 addition & 13 deletions Vizpower Plugin Installer/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Vizpower Plugin Installer/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@
<Setting Name="FilePath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="FileName" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
30 changes: 15 additions & 15 deletions Vizpower Plugin Installer/Properties/app.config
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Vizpower_Plugin_Installer_WPF.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup><userSettings>
<Vizpower_Plugin_Installer_WPF.Properties.Settings>
<setting name="FilePath" serializeAs="String">
<value />
</setting>
<setting name="FileName" serializeAs="String">
<value />
</setting>
</Vizpower_Plugin_Installer_WPF.Properties.Settings>
</userSettings>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Vizpower_Plugin_Installer_WPF.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<userSettings>
<Vizpower_Plugin_Installer_WPF.Properties.Settings>
<setting name="FilePath" serializeAs="String">
<value />
</setting>
</Vizpower_Plugin_Installer_WPF.Properties.Settings>
</userSettings>
</configuration>
8 changes: 4 additions & 4 deletions Vizpower Plugin Installer/Vizpower Plugin Installer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -26,11 +29,8 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -126,8 +126,8 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="Properties\packages.config" />
<None Include="Properties\app.config" />
<None Include="Properties\packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down

0 comments on commit 70685a1

Please sign in to comment.