mirror of
https://github.com/JosefNemec/Playnite.git
synced 2026-01-09 06:11:22 +08:00
Small tweaks to online installer
This commit is contained in:
parent
814ddac821
commit
c136792790
@ -23,12 +23,24 @@ namespace PlayniteInstaller
|
||||
Installing
|
||||
}
|
||||
|
||||
public class CustomWebClient : WebClient
|
||||
{
|
||||
protected override WebRequest GetWebRequest(Uri address)
|
||||
{
|
||||
var request = base.GetWebRequest(address);
|
||||
if (request != null)
|
||||
request.Timeout = 10 * 1000;
|
||||
|
||||
return request;
|
||||
}
|
||||
}
|
||||
|
||||
public class MainViewModel : ObservableObject
|
||||
{
|
||||
private static readonly ILogger logger = LogManager.GetLogger();
|
||||
private readonly Window windowHost;
|
||||
private readonly List<string> UrlMirrors;
|
||||
private WebClient webClient;
|
||||
private CustomWebClient webClient;
|
||||
|
||||
private InstallStatus status;
|
||||
public InstallStatus Status
|
||||
@ -172,7 +184,7 @@ namespace PlayniteInstaller
|
||||
webClient = null;
|
||||
}
|
||||
|
||||
webClient = new WebClient();
|
||||
webClient = new CustomWebClient();
|
||||
var installerUrls = await TryDownloadManifest(UrlMirrors);
|
||||
webClient.DownloadProgressChanged += WebClient_DownloadProgressChanged;
|
||||
if (await TryDownloadInstaller(installerUrls) == false)
|
||||
|
||||
@ -32,25 +32,23 @@
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
|
||||
<Expander Header="Options" Margin="10" FontSize="{StaticResource FontSize}"
|
||||
Visibility="{Binding Status, Converter={StaticResource InstallStatusToVisibilityConverter}, ConverterParameter={x:Static local:InstallStatus.Idle}}">
|
||||
<StackPanel>
|
||||
<DockPanel Margin="5">
|
||||
<TextBlock Text="Destination Folder" DockPanel.Dock="Left" Margin="10,5,10,5" />
|
||||
<Button Content="Browse..." DockPanel.Dock="Right"
|
||||
Command="{Binding BrowseCommand}"
|
||||
Padding="10,0,10,0" Margin="10,0,10,0"/>
|
||||
<TextBox DockPanel.Dock="Left" VerticalContentAlignment="Center"
|
||||
Text="{Binding DestionationFolder,UpdateSourceTrigger=PropertyChanged}" />
|
||||
</DockPanel>
|
||||
<StackPanel Visibility="{Binding Status, Converter={StaticResource InstallStatusToVisibilityConverter}, ConverterParameter={x:Static local:InstallStatus.Idle}}"
|
||||
Margin="0,15,0,5">
|
||||
<DockPanel Margin="5">
|
||||
<TextBlock Text="Destination Folder" DockPanel.Dock="Left" Margin="10,5,10,5" />
|
||||
<Button Content="Browse..." DockPanel.Dock="Right"
|
||||
Command="{Binding BrowseCommand}"
|
||||
Padding="10,0,10,0" Margin="10,0,10,0"/>
|
||||
<TextBox DockPanel.Dock="Left" VerticalContentAlignment="Center"
|
||||
Text="{Binding DestionationFolder,UpdateSourceTrigger=PropertyChanged}" />
|
||||
</DockPanel>
|
||||
|
||||
<CheckBox Content="Portable" HorizontalAlignment="Left"
|
||||
IsChecked="{Binding Portable}"
|
||||
ToolTipService.InitialShowDelay="0"
|
||||
ToolTip="Installs Playnite in Portable mode.
All configuration files and game database will be stored in application's folder."
|
||||
Margin="15,10,10,10"/>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
<CheckBox Content="Portable" HorizontalAlignment="Left"
|
||||
IsChecked="{Binding Portable}"
|
||||
ToolTipService.InitialShowDelay="0"
|
||||
ToolTip="Installs Playnite in Portable mode.
All configuration files and game database will be stored in application's folder."
|
||||
Margin="15,10,10,10"/>
|
||||
</StackPanel>
|
||||
|
||||
<ProgressBar HorizontalAlignment="Stretch" Height="25" Margin="15,10,15,10"
|
||||
Minimum="0" Maximum="100" Value="{Binding ProgressValue}">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user