remove broken updater for now

This commit is contained in:
fyr77 2021-05-08 00:04:40 +02:00
parent 85ae027c28
commit b54de3eb36
5 changed files with 56 additions and 32 deletions

View file

@ -9,7 +9,7 @@ namespace EnvyUpdate
public static readonly string exeloc = System.Reflection.Assembly.GetEntryAssembly().Location;
public static readonly string exepath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\";
public static readonly string startmenu = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
public static readonly float version = 2.7F;
public static readonly float version = 2.8F;
public static readonly string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\envyupdate\\";
public static readonly string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
public static readonly string desktopOverride = exepath + "desktop.envy";

View file

@ -19,9 +19,7 @@
<Button x:Name="buttonHelp" Content="..." Margin="0,12,10,0" Click="buttonHelp_Click" HorizontalAlignment="Right" Width="20" Height="20" VerticalAlignment="Top" Grid.RowSpan="2"/>
<TextBlock Margin="10,40,0,0" TextWrapping="Wrap" FontWeight="Bold" Grid.Row="1" HorizontalAlignment="Left" Width="151" Height="16" VerticalAlignment="Top"><Run Text="{x:Static p:Resources.ui_onlinedriver}"/></TextBlock>
<TextBlock x:Name="textblockOnline" HorizontalAlignment="Right" Margin="0,40,10,0" TextWrapping="Wrap" Text="&lt;none&gt;" Width="106" Grid.Row="1" Height="16" VerticalAlignment="Top" TextAlignment="Right"/>
<CheckBox x:Name="chkInstall" Content="{x:Static p:Resources.ui_install}" HorizontalAlignment="Left" Margin="10,83,0,0" IsChecked="False" Unchecked="chkInstall_Unchecked" Checked="chkInstall_Checked" Width="51" Grid.Row="1" Height="16" VerticalAlignment="Top"/>
<Button x:Name="buttonDL" Content="⟱" Margin="0,0,10,10" FontSize="20" Click="buttonDL_Click" Foreground="White" Background="#FF3CDA00" Visibility="Hidden" Grid.Row="1" HorizontalAlignment="Right" Width="30" Height="30" VerticalAlignment="Bottom"/>
<CheckBox x:Name="chkAutostart" Content="{x:Static p:Resources.ui_autostart}" HorizontalAlignment="Left" Margin="10,62,0,0" IsEnabled="False" Checked="chkAutostart_Checked" Unchecked="chkAutostart_Unchecked" Width="69" Grid.Row="1" Height="16" VerticalAlignment="Top"/>
<TextBlock x:Name="textblockGPUName" Margin="10,14,35,0" TextWrapping="Wrap" Text="GPU..." Height="16" VerticalAlignment="Top" TextAlignment="Center" Grid.RowSpan="2" FontWeight="Bold"/>
</Grid>
</Window>

View file

@ -42,12 +42,15 @@ namespace EnvyUpdate
Environment.Exit(1);
}
// Set correct ticks
/*
if (File.Exists(GlobalVars.startup + "\\EnvyUpdate.lnk"))
chkAutostart.IsChecked = true;
if (File.Exists(GlobalVars.appdata + "EnvyUpdate.exe"))
chkInstall.IsChecked = true;
chkInstall.IsChecked = true;*/
//ALSO BROKEN
// Check if application is installed and update
/*
if (GlobalVars.exepath == GlobalVars.appdata)
{
try
@ -63,7 +66,11 @@ namespace EnvyUpdate
}
// Also set correct ticks.
chkInstall.IsChecked = true;
}
}*/
//BROKEN
// Delete installed versions
UninstallAll();
// Check for overrides
if (File.Exists(GlobalVars.desktopOverride))
@ -189,7 +196,7 @@ namespace EnvyUpdate
}
}
private void chkInstall_Checked(object sender, RoutedEventArgs e)
/*private void chkInstall_Checked(object sender, RoutedEventArgs e)
{
if (chkAutostart != null)
{
@ -247,6 +254,29 @@ namespace EnvyUpdate
{
File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
}
*/
public void UninstallAll()
{
if (File.Exists(GlobalVars.startup + "\\EnvyUpdate.lnk"))
{
File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
}
if (File.Exists(GlobalVars.startmenu + "\\EnvyUpdate.lnk"))
{
File.Delete(GlobalVars.startmenu + "\\EnvyUpdate.lnk");
}
if ((GlobalVars.exepath == GlobalVars.appdata) && File.Exists(GlobalVars.appdata + "EnvyUpdate.exe"))
{
MessageBox.Show("EnvyUpdate must be uninstalled because of an application bug. Please download the most recent version again.");
Util.SelfDelete();
}
else if (Directory.Exists(GlobalVars.appdata))
{
Directory.Delete(GlobalVars.appdata, true);
}
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{

View file

@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.7")]
[assembly: AssemblyFileVersion("2.7")]
[assembly: AssemblyVersion("2.8")]
[assembly: AssemblyFileVersion("2.8")]