mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-24 12:35:31 +00:00
Builder direct run detection.
This commit is contained in:
parent
ab16e988b9
commit
c82ce91957
3 changed files with 22 additions and 3 deletions
15
install.bat
15
install.bat
|
|
@ -1,7 +1,16 @@
|
||||||
|
@REM Delete so if builder fails it wont exist
|
||||||
del source2\Build\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.*
|
del source2\Build\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.*
|
||||||
|
|
||||||
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "source2\Builder.sln" /maxcpucount /verbosity:normal /nologo /p:Configuration=Debug /p:Platform=x86
|
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "source2\Builder.sln" /nologo /p:Configuration=Debug /p:Platform=x86
|
||||||
|
|
||||||
source2\Build\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
|
@if not exist source2\Build\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.exe goto error
|
||||||
|
|
||||||
pause
|
start source2\Build\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.exe -bat %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
|
||||||
|
@exit
|
||||||
|
|
||||||
|
:Error
|
||||||
|
@echo _
|
||||||
|
@echo _
|
||||||
|
@echo Something went wrong.
|
||||||
|
@pause
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,11 @@ namespace Cosmos.Build.Builder {
|
||||||
public static bool UseTask;
|
public static bool UseTask;
|
||||||
public static bool InstallTask;
|
public static bool InstallTask;
|
||||||
public static bool IgnoreVS;
|
public static bool IgnoreVS;
|
||||||
|
public static bool HasParams = false;
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e) {
|
protected override void OnStartup(StartupEventArgs e) {
|
||||||
|
HasParams = e.Args.Length > 0;
|
||||||
|
|
||||||
var xArgs = new string[e.Args.Length];
|
var xArgs = new string[e.Args.Length];
|
||||||
for (int i = 0; i < xArgs.Length; i++) {
|
for (int i = 0; i < xArgs.Length; i++) {
|
||||||
xArgs[i] = e.Args[i].ToUpper();
|
xArgs[i] = e.Args[i].ToUpper();
|
||||||
|
|
|
||||||
|
|
@ -255,8 +255,15 @@ namespace Cosmos.Build.Builder {
|
||||||
|
|
||||||
protected bool mLoaded = false;
|
protected bool mLoaded = false;
|
||||||
void Window_Loaded(object sender, RoutedEventArgs e) {
|
void Window_Loaded(object sender, RoutedEventArgs e) {
|
||||||
|
if (!App.HasParams) {
|
||||||
|
MessageBox.Show("Builder not meant to be called directly. Use install.bat instead.");
|
||||||
|
Close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LoadPosition();
|
LoadPosition();
|
||||||
mLoaded = true;
|
mLoaded = true;
|
||||||
|
|
||||||
string xAppPath = System.AppDomain.CurrentDomain.BaseDirectory;
|
string xAppPath = System.AppDomain.CurrentDomain.BaseDirectory;
|
||||||
mCosmosDir = Path.GetFullPath(xAppPath + @"..\..\..\..\..\");
|
mCosmosDir = Path.GetFullPath(xAppPath + @"..\..\..\..\..\");
|
||||||
mSetupPath = Path.Combine(mCosmosDir, @"Setup2\Output\CosmosUserKit-" + mReleaseNo + ".exe");
|
mSetupPath = Path.Combine(mCosmosDir, @"Setup2\Output\CosmosUserKit-" + mReleaseNo + ".exe");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue