add inno pack file
This commit is contained in:
parent
1d21654404
commit
e7851cd2f6
|
@ -360,4 +360,6 @@ MigrationBackup/
|
||||||
.ionide/
|
.ionide/
|
||||||
|
|
||||||
# Fody - auto-generated XML schema
|
# Fody - auto-generated XML schema
|
||||||
FodyWeavers.xsd
|
FodyWeavers.xsd
|
||||||
|
|
||||||
|
Output
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:Topuino_Client_Windows"
|
xmlns:local="clr-namespace:Topuino_Client_Windows"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
Closing="Window_Closing"
|
||||||
Title="Topuino 客户端" Height="150" Width="400">
|
Title="Topuino 客户端" Height="150" Width="400">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5">
|
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5">
|
||||||
<Button Content="保存" Click="Button_Save_Click" Height="20" Width="40" />
|
<Button Content="保存" Click="Button_Save_Click" Height="20" Width="40" />
|
||||||
<Separator Width="10" Background="Transparent" />
|
<Separator Width="10" Background="Transparent" />
|
||||||
<Button Content="隐藏" Height="20" Width="40" />
|
<Button Content="隐藏" Click="Button_Hide_Click" Height="20" Width="40" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
@ -6,6 +6,8 @@ using System.IO;
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Topuino_Client_Windows
|
namespace Topuino_Client_Windows
|
||||||
|
@ -36,6 +38,8 @@ namespace Topuino_Client_Windows
|
||||||
|
|
||||||
if (File.Exists("Config.json"))
|
if (File.Exists("Config.json"))
|
||||||
{
|
{
|
||||||
|
ShowInTaskbar = true;
|
||||||
|
Visibility = Visibility.Hidden;
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -43,8 +47,15 @@ namespace Topuino_Client_Windows
|
||||||
ComboBox_Disk0.SelectedIndex = 0;
|
ComboBox_Disk0.SelectedIndex = 0;
|
||||||
ComboBox_Disk1.SelectedIndex = 0;
|
ComboBox_Disk1.SelectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trayIon.Icon = new Icon(@"Topuino.ico");
|
||||||
|
trayIon.Visible = true;
|
||||||
|
trayIon.Text = "Topuino";
|
||||||
|
trayIon.DoubleClick += TrayIcon_DoubleClick;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private NotifyIcon trayIon = new NotifyIcon();
|
||||||
|
|
||||||
private string sn = "";
|
private string sn = "";
|
||||||
private List<DriveInfo> allDrives;
|
private List<DriveInfo> allDrives;
|
||||||
private DriveInfo? drive0 = null;
|
private DriveInfo? drive0 = null;
|
||||||
|
@ -159,8 +170,8 @@ namespace Topuino_Client_Windows
|
||||||
|
|
||||||
public void ShowErrorBox(string msg)
|
public void ShowErrorBox(string msg)
|
||||||
{
|
{
|
||||||
MessageBox.Show(
|
System.Windows.MessageBox.Show(
|
||||||
Application.Current.MainWindow,
|
System.Windows.Application.Current.MainWindow,
|
||||||
msg,
|
msg,
|
||||||
"错误",
|
"错误",
|
||||||
MessageBoxButton.OK,
|
MessageBoxButton.OK,
|
||||||
|
@ -177,7 +188,7 @@ namespace Topuino_Client_Windows
|
||||||
|
|
||||||
private void StartRun()
|
private void StartRun()
|
||||||
{
|
{
|
||||||
Mouse.OverrideCursor = Cursors.Wait;
|
Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
|
||||||
if (refreshThread != null)
|
if (refreshThread != null)
|
||||||
{
|
{
|
||||||
requestStop.Set();
|
requestStop.Set();
|
||||||
|
@ -218,5 +229,24 @@ namespace Topuino_Client_Windows
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
StartRun();
|
StartRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TrayIcon_DoubleClick(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Hide_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Visibility = Visibility.Hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
|
{
|
||||||
|
if (refreshThread != null)
|
||||||
|
{
|
||||||
|
requestStop.Set();
|
||||||
|
stopDone.WaitOne();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -5,10 +5,15 @@
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="xcopy "$(ProjectDir)Topuino.ico" "$(ProjectDir)$(OutDir)" /y /f" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
; Script generated by the Inno Setup Script Wizard.
|
||||||
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
|
#define MyAppName "TopuinoClient"
|
||||||
|
#define MyAppVersion "0.1"
|
||||||
|
#define MyAppPublisher "VVZERO"
|
||||||
|
#define MyAppURL "https://iot.vvzero.com"
|
||||||
|
#define MyAppExeName "Topuino_Client_Windows.exe"
|
||||||
|
|
||||||
|
[Setup]
|
||||||
|
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
|
||||||
|
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||||
|
AppId={{775354B5-2CB5-4689-B28C-534A1848B810}
|
||||||
|
AppName={#MyAppName}
|
||||||
|
AppVersion={#MyAppVersion}
|
||||||
|
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||||
|
AppPublisher={#MyAppPublisher}
|
||||||
|
AppPublisherURL={#MyAppURL}
|
||||||
|
AppSupportURL={#MyAppURL}
|
||||||
|
AppUpdatesURL={#MyAppURL}
|
||||||
|
DefaultDirName={autopf}\{#MyAppName}
|
||||||
|
DisableDirPage=yes
|
||||||
|
DisableProgramGroupPage=yes
|
||||||
|
; Remove the following line to run in administrative install mode (install for all users.)
|
||||||
|
PrivilegesRequired=lowest
|
||||||
|
OutputDir=Output
|
||||||
|
OutputBaseFilename=Topuino_Client
|
||||||
|
SetupIconFile=Topuino.ico
|
||||||
|
Compression=lzma
|
||||||
|
SolidCompression=yes
|
||||||
|
WizardStyle=modern
|
||||||
|
|
||||||
|
[Languages]
|
||||||
|
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "bin\Release\net6.0-windows\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||||
|
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||||
|
|
||||||
|
[Run]
|
||||||
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||||
|
|
Loading…
Reference in New Issue