mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 12:35:52 -04:00
Fix update for wine, this time for sure.
This commit is contained in:
parent
563afc244f
commit
689cfccb0c
@ -24,22 +24,15 @@ namespace Launcher.Updater {
|
||||
public static void LaunchUpdateScript() {
|
||||
ProcessStartInfo info = new ProcessStartInfo();
|
||||
info.CreateNoWindow = false;
|
||||
info.UseShellExecute = false;
|
||||
info.UseShellExecute = true;
|
||||
info.WorkingDirectory = Program.AppDirectory;
|
||||
|
||||
if( OpenTK.Configuration.RunningOnWindows ) {
|
||||
string path = Path.Combine( Program.AppDirectory, "update.bat" );
|
||||
File.WriteAllText( path, Scripts.BatchFile );
|
||||
// First try for wine
|
||||
info.FileName = "xterm"; info.Arguments = "-e \"wine cmd.exe /c update.bat\"";
|
||||
try {
|
||||
Process.Start( info );
|
||||
} catch( Exception ) {
|
||||
// Then try for normal Windows
|
||||
info.FileName = "cmd.exe"; info.Arguments = "/c update.bat\"";
|
||||
Process.Start( info );
|
||||
}
|
||||
} else {
|
||||
info.FileName = "cmd"; info.Arguments = "/C start cmd /C update.bat";
|
||||
Process.Start( info );
|
||||
} else {
|
||||
string path = Path.Combine( Program.AppDirectory, "update.sh" );
|
||||
File.WriteAllText( path, Scripts.BashFile.Replace( "\r\n", "\n" ) );
|
||||
const int flags = 0x7;// read | write | executable
|
||||
@ -48,7 +41,7 @@ namespace Launcher.Updater {
|
||||
throw new InvalidOperationException( "chmod returned : " + code );
|
||||
|
||||
//if( OpenTK.Configuration.RunningOnMacOS )
|
||||
// info = new ProcessStartInfo( "open -a Terminal ",
|
||||
// info = new ProcessStartInfo( "open -a Terminal ",
|
||||
// '"' + path + '"');
|
||||
//else
|
||||
info.FileName = "xterm"; info.Arguments = '"' + path + '"';
|
||||
|
@ -21,7 +21,7 @@ sleep 1
|
||||
|
||||
set root=%CD%
|
||||
echo Extracting files from CS_Update folder
|
||||
for /f %%f in ('dir /b ""%root%\CS_Update""') do move /Y ""%root%\CS_Update\%%f"" ""%root%\%%f""
|
||||
for /f %%f in ('dir /b ""%root%\CS_Update""') do move ""%root%\CS_Update\%%f"" ""%root%\%%f""
|
||||
rmdir ""%root%\CS_Update""
|
||||
|
||||
echo Starting launcher again
|
||||
|
Loading…
x
Reference in New Issue
Block a user