Fix launcher script not having proper working directory set on unix.

This commit is contained in:
UnknownShadow200 2016-04-16 08:29:30 +10:00
parent 647189616b
commit 61af80b487
5 changed files with 12 additions and 35 deletions

View File

@ -39,12 +39,6 @@ namespace ClassicalSharp {
brush.SetStyle( Paint.Style.FillAndStroke );
}
[Obsolete]
public override void DrawRoundedRect( FastColour colour, float radius, float x, float y, float width, float height ) {
RectF rec = new RectF( x, y, x + width, y + height );
c.DrawRoundRect( rec, radius, radius, GetOrCreateBrush( colour ) );
}
public override void Clear( FastColour colour ) {
c.DrawColor( colour );
}

View File

@ -38,27 +38,6 @@ namespace ClassicalSharp {
}
}
[Obsolete("Method is not guaranteed to work on all platforms.")]
public override void DrawRoundedRect( FastColour colour, float radius, float x, float y, float width, float height ) {
GraphicsPath path = new GraphicsPath();
float x1 = x, y1 = y, x2 = x + width, y2 = y + height;
float r = radius, dia = radius * 2;
path.AddArc( x1, y1, dia, dia, 180, 90 );
path.AddLine( x1 + r, y1, x2 - r, y1 );
path.AddArc( x2 - dia, y1, dia, dia, 270, 90 );
path.AddLine( x2, y1 + r, x2, y2 - r );
path.AddArc( x2 - dia, y2 - dia, dia, dia, 0, 90 );
path.AddLine( x1 + r, y2, x2 - r, y2 );
path.AddArc( x1, y2 - dia, dia, dia, 90, 90 );
path.AddLine( x1, y1 + r, x1, y2 - r );
path.CloseAllFigures();
using( Brush brush = new SolidBrush( colour ) )
g.FillPath( brush, path );
path.Dispose();
}
public override void Clear( FastColour colour ) {
g.Clear( colour );
}

View File

@ -32,11 +32,6 @@ namespace ClassicalSharp {
/// at the specified coordinates in the currently bound bitmap. </summary>
public abstract void DrawRectBounds( FastColour colour, float lineWidth, int x, int y, int width, int height );
/// <summary> Draws a 2D rectangle with rounded borders of the specified dimensions
/// at the specified coordinates in the currently bound bitmap. </summary>
[Obsolete("Method is not guaranteed to work on all platforms.")]
public abstract void DrawRoundedRect( FastColour colour, float radius, float x, float y, float width, float height );
/// <summary> Clears the entire bound bitmap to the specified colour. </summary>
public abstract void Clear( FastColour colour );

View File

@ -177,9 +177,11 @@ namespace Launcher {
LauncherSkin.SaveToOptions();
Options.Save();
}
if( ShouldUpdate )
Updater.Patcher.LaunchUpdateScript();
Window.Close();
if( Window.Exists )
Window.Close();
}
void Display() {

View File

@ -34,10 +34,16 @@ namespace Launcher.Updater {
int code = chmod( path, (flags << 6) | (flags << 3) | 4 );
if( code != 0 )
throw new InvalidOperationException( "chmod returned : " + code );
info = new ProcessStartInfo( "xterm", '"' + path + '"');
//if( OpenTK.Configuration.RunningOnMacOS )
// info = new ProcessStartInfo( "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal",
// '"' + path + '"');
//else
info = new ProcessStartInfo( "xterm", '"' + path + '"');
}
info.CreateNoWindow = false;
info.UseShellExecute = false;
info.WorkingDirectory = Program.AppDirectory;
Process.Start( info );
}
@ -47,7 +53,8 @@ namespace Launcher.Updater {
static void MakeUpdatesFolder( byte[] zipData ) {
using( MemoryStream stream = new MemoryStream( zipData ) ) {
ZipReader reader = new ZipReader();
Directory.CreateDirectory( "CS_Update" );
string path = Path.Combine( Program.AppDirectory, "CS_Update" );
Directory.CreateDirectory( path );
reader.ShouldProcessZipEntry = (f) => true;
reader.ProcessZipEntry = ProcessZipEntry;