Add Reinstall button.

This commit is contained in:
Jared Goodwin 2020-03-02 18:55:30 -08:00
parent eb11b3a811
commit c6a02da883
2 changed files with 15 additions and 11 deletions

View File

@ -69,6 +69,7 @@
Command="{Binding OpenLogsCommand}">
Logs
</Button>
<Button DockPanel.Dock="Right"
HorizontalAlignment="Right"
Style="{StaticResource NormalButton}"
@ -76,15 +77,6 @@
Click="CloseButton_Click">
Close
</Button>
<Button DockPanel.Dock="Right"
HorizontalAlignment="Right"
Style="{StaticResource NormalButton}"
Margin="5,0,0,0"
IsEnabled="{Binding IsReadyState}"
Visibility="{Binding IsServiceMissing, Converter={StaticResource BooleanToVisibilityConverter}}"
Command="{Binding InstallCommand}">
Install
</Button>
<Button DockPanel.Dock="Right"
HorizontalAlignment="Right"
Style="{StaticResource NormalButton}"
@ -94,6 +86,14 @@
Command="{Binding UninstallCommand}">
Uninstall
</Button>
<Button DockPanel.Dock="Right"
HorizontalAlignment="Right"
Style="{StaticResource NormalButton}"
Content="{Binding InstallButtonText}"
Margin="5,0,0,0"
IsEnabled="{Binding IsReadyState}"
Command="{Binding InstallCommand}">
</Button>
</DockPanel>
</Grid>
</Window>

View File

@ -49,6 +49,8 @@ namespace Remotely.Agent.Installer.Win.ViewModels
}
}
public string InstallButtonText => IsServiceMissing ? "Install" : "Reinstall";
public ICommand InstallCommand => new Executor(async (param) => { await Install(param); });
public bool IsProgressVisible => Progress > 0;
@ -77,6 +79,7 @@ namespace Remotely.Agent.Installer.Win.ViewModels
isServiceInstalled = value;
FirePropertyChanged(nameof(IsServiceInstalled));
FirePropertyChanged(nameof(IsServiceMissing));
FirePropertyChanged(nameof(InstallButtonText));
}
}
@ -180,8 +183,9 @@ namespace Remotely.Agent.Installer.Win.ViewModels
}
else
{
HeaderMessage = "Uninstall the Remotely service.";
StatusMessage = "Uninstalling the Remotely service will remove all remote acess to this device.";
HeaderMessage = "Modify the Remotely installation.";
StatusMessage = "Uninstalling the Remotely service will remove all remote acess to this device.\r\n\r\n" +
"Reinstalling will retain the current settings and install the service again.";
}
var installerSettings = ReadInstallerSettings();