setup redesign
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
- Load AviSynth DLL from environment variable AviSynthDLL
|
||||
in order to support AviSynth portable mode.
|
||||
- New option global-media-keys (next, previous, play/pause, stop).
|
||||
- Improved setup dialog.
|
||||
- Redesigned PowerShell based setup and setup dialog.
|
||||
- Whenever there is a new startup location, the setup dialog is shown.
|
||||
- libmpv updated to shinshiro 2020-11-22.
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<Button Name="AddVideo" Click="AddVideo_Click" Template="{StaticResource ShieldButtonTemplate}">Add Video</Button>
|
||||
<Button Name="AddAudio" Click="AddAudio_Click" Template="{StaticResource ShieldButtonTemplate}">Add Audio</Button>
|
||||
<Button Name="AddImage" Click="AddImage_Click" Template="{StaticResource ShieldButtonTemplate}">Add Image</Button>
|
||||
<Button Name="RemoveFileAssociations" Click="RemoveFileAssociations_Click" Template="{StaticResource ShieldButtonTemplate}">Remove All</Button>
|
||||
<Button Name="RemoveFileAssociations" Margin="3,15,3,3" Click="RemoveFileAssociations_Click" Template="{StaticResource ShieldButtonTemplate}">Remove All</Button>
|
||||
<Button Name="EditDefaultApp" Click="EditDefaultApp_Click">Edit Default App</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Width="180" Margin="20,5,5,5">
|
||||
|
||||
@@ -71,30 +71,12 @@ namespace mpvnet
|
||||
|
||||
void AddToPathEnvVar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string var = Folder.Startup.TrimEnd(Path.DirectorySeparatorChar) + ";";
|
||||
string path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.User);
|
||||
|
||||
if (path.Contains(var))
|
||||
Msg.ShowWarning("Path was already containing mpv.net.");
|
||||
else
|
||||
{
|
||||
Environment.SetEnvironmentVariable("Path", var + path, EnvironmentVariableTarget.User);
|
||||
Msg.Show("mpv.net was successfully added to Path.", (var + path).Replace(";","\n"));
|
||||
}
|
||||
ExecutePowerShellScript(Folder.Startup + "Setup\\add environment variable.ps1");
|
||||
}
|
||||
|
||||
void RemoveFromPathEnvVar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string var = Folder.Startup.TrimEnd(Path.DirectorySeparatorChar) + ";";
|
||||
string path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.User);
|
||||
|
||||
if (path.Contains(var))
|
||||
{
|
||||
Environment.SetEnvironmentVariable("Path", path.Replace(var, ""), EnvironmentVariableTarget.User);
|
||||
Msg.Show("mpv.net was successfully removed from Path.");
|
||||
}
|
||||
else
|
||||
Msg.ShowWarning("Path was not containing mpv.net.");
|
||||
ExecutePowerShellScript(Folder.Startup + "Setup\\remove environment variable.ps1");
|
||||
}
|
||||
|
||||
void AddStartMenuShortcut_Click(object sender, RoutedEventArgs e)
|
||||
@@ -117,7 +99,7 @@ namespace mpvnet
|
||||
ProcessHelp.Execute("powershell.exe", "-NoLogo -NoExit -ExecutionPolicy Bypass -File \"" + file + "\"");
|
||||
}
|
||||
|
||||
private void EditDefaultApp_Click(object sender, RoutedEventArgs e)
|
||||
void EditDefaultApp_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ProcessHelp.ShellExecute("ms-settings:defaultapps");
|
||||
}
|
||||
|
||||
@@ -42,3 +42,4 @@ Source: "{#MyAppSourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesub
|
||||
[UninstallRun]
|
||||
Filename: "powershell.exe"; Flags: runhidden; Parameters: "-ExecutionPolicy Bypass -File ""{app}\Setup\remove file associations.ps1"""
|
||||
Filename: "powershell.exe"; Flags: runhidden; Parameters: "-ExecutionPolicy Bypass -File ""{app}\Setup\remove start menu shortcut.ps1"""
|
||||
Filename: "powershell.exe"; Flags: runhidden; Parameters: "-ExecutionPolicy Bypass -File ""{app}\Setup\remove environment variable.ps1"""
|
||||
|
||||
Reference in New Issue
Block a user