Skip to content

Commit

Permalink
v7.0.0.4 Beta
Browse files Browse the repository at this point in the history
  • Loading branch information
stax76 committed Dec 19, 2023
1 parent ed48f5c commit a3b9c65
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 20 deletions.
8 changes: 6 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# v7.0.0.4 Beta (2023-??-??)
# v7.0.0.4 Beta (2023-12-19)

- When mpv.net is started for the first time from a new startup location,
it asks if file associations should be registered.
- Setup supports installing per user in non admin mode.
- Command line parser supports list options with `-add` suffix.
- Fix window sometimes shown with wrong size.
- Limited support for the mpv option `geometry`, it supports location in percent,
Expand Down Expand Up @@ -31,7 +34,8 @@
- Conf editor support added for the mpv options:
`reset-on-next-file`, `input-ipc-server`, `background`, `title`
- Conf editor crash fixed.
- When mpv.net is started for the first time from a new startup location, it asks if mpv.net should be added to the Path environment variable.
- When mpv.net is started for the first time from a new startup location,
it asks if mpv.net should be added to the Path environment variable.

# v7.0.0.2 Beta (2023-12-13)

Expand Down
48 changes: 35 additions & 13 deletions src/MpvNet.Windows/Help/WinMpvHelp.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,58 @@

using System.Windows;

using MpvNet.Windows.WPF;

namespace MpvNet.Windows.Help;

public class WinMpvHelp
{
public static void AddToPath()
public static void Setup()
{
string path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.User)!;
string dir = RegistryHelp.GetString("PathEnvVarCheck"); // backward compatibility

if (path.ToLower().Contains(Folder.Startup.TrimEnd(Path.DirectorySeparatorChar).ToLower()))
if (dir == Folder.Startup)
return;

string dir = RegistryHelp.GetString("PathEnvVarCheck");
dir = RegistryHelp.GetString("Setup");

if (dir == Folder.Startup)
return;

var result = Msg.ShowQuestion("Would you like to add mpv.net to the Path environment variable?",
MessageBoxButton.YesNo);
string path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.User)!;

if (result == MessageBoxResult.Yes)
if (!path.ToLower().Contains(Folder.Startup.TrimEnd(Path.DirectorySeparatorChar).ToLower()))
{
Environment.SetEnvironmentVariable("Path",
Folder.Startup.TrimEnd(Path.DirectorySeparatorChar) + ";" + path,
EnvironmentVariableTarget.User);
var result = Msg.ShowQuestion("Would you like to add mpv.net to the Path environment variable?" + BR2 +
"This will allow using mpv.net in a console/terminal.", MessageBoxButton.YesNo);

if (result == MessageBoxResult.Yes)
{
Environment.SetEnvironmentVariable("Path",
Folder.Startup.TrimEnd(Path.DirectorySeparatorChar) + ";" + path,
EnvironmentVariableTarget.User);

Msg.ShowInfo("mpv.net was added successfully to Path.");
}
else
Msg.ShowInfo("If you want to add mpv.net to the Path environment variable later," + BR +
"you can do so with the context menu (Settings/Setup)");
}

var result2 = Msg.ShowQuestion("Would you like to register video file associations?", MessageBoxButton.YesNo);

if (result2 == MessageBoxResult.Yes)
{
Player.Command("script-message-to mpvnet reg-file-assoc video");

result2 = Msg.ShowQuestion("Would you like to register audio file associations?", MessageBoxButton.YesNo);

Msg.ShowInfo("mpv.net was added successfully to Path.");
if (result2 == MessageBoxResult.Yes)
Player.Command("script-message-to mpvnet reg-file-assoc audio");
}
else
Msg.ShowInfo("If you want to register file associations later," + BR +
"you can do so with the context menu (Settings/Setup)");

RegistryHelp.SetString("PathEnvVarCheck", Folder.Startup);
RegistryHelp.SetString("Setup", Folder.Startup);
}
}
6 changes: 3 additions & 3 deletions src/MpvNet.Windows/MpvNet.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>mpv-icon.ico</ApplicationIcon>
<Product>mpv.net</Product>
<FileVersion>7.0.0.3</FileVersion>
<AssemblyVersion>7.0.0.3</AssemblyVersion>
<InformationalVersion>7.0.0.3</InformationalVersion>
<FileVersion>7.0.0.4</FileVersion>
<AssemblyVersion>7.0.0.4</AssemblyVersion>
<InformationalVersion>7.0.0.4</InformationalVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/MpvNet.Windows/WinForms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ protected override void OnShown(EventArgs e)

TaskHelp.Run(() => {
System.Windows.Application.Current.Dispatcher.BeginInvoke(() => {
WinMpvHelp.AddToPath();
WinMpvHelp.Setup();
}, DispatcherPriority.Background);
});
}
Expand Down
4 changes: 3 additions & 1 deletion src/Setup/Inno/inno-setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ AppVersion={#MyAppVersion}
AppPublisher=Frank Skare (stax76)
ArchitecturesInstallIn64BitMode=x64
Compression=lzma2
DefaultDirName={commonpf}\{#MyAppName}
DefaultDirName={autopf}\{#MyAppName}
OutputBaseFilename=mpv.net-v{#MyAppVersion}-setup
OutputDir=E:\Desktop
DefaultGroupName={#MyAppName}
SetupIconFile=..\..\MpvNet.Windows\mpv-icon.ico
UninstallDisplayIcon={app}\{#MyAppExeName}
PrivilegesRequired=admin
PrivilegesRequiredOverridesAllowed=dialog

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Expand Down

0 comments on commit a3b9c65

Please sign in to comment.