New checkbox to stop updating build files and tree.

Constantly have to revert files manually from git :)
This commit is contained in:
Raymix 2016-06-17 18:55:33 +01:00
parent 66a553c2fb
commit 923788949b

View File

@ -448,6 +448,13 @@ $TabPage3.Size = New-Object System.Drawing.Size(800, 492)
$TabPage3.TabIndex = 2 $TabPage3.TabIndex = 2
$TabPage3.Text = "Developers" $TabPage3.Text = "Developers"
$TabPage3.BackColor = [System.Drawing.SystemColors]::Control $TabPage3.BackColor = [System.Drawing.SystemColors]::Control
#~~< CheckBox2 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$CheckBox2 = New-Object System.Windows.Forms.CheckBox
$CheckBox2.Location = New-Object System.Drawing.Point(78, 6)
$CheckBox2.Size = New-Object System.Drawing.Size(178, 24)
$CheckBox2.TabIndex = 27
$CheckBox2.Text = "Update versions when packing"
$CheckBox2.UseVisualStyleBackColor = $true
#~~< Button15 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #~~< Button15 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$Button15 = New-Object System.Windows.Forms.Button $Button15 = New-Object System.Windows.Forms.Button
$Button15.Location = New-Object System.Drawing.Point(6, 173) $Button15.Location = New-Object System.Drawing.Point(6, 173)
@ -521,6 +528,7 @@ $CheckBox1.Size = New-Object System.Drawing.Size(66, 24)
$CheckBox1.TabIndex = 14 $CheckBox1.TabIndex = 14
$CheckBox1.Text = "Enable" $CheckBox1.Text = "Enable"
$CheckBox1.UseVisualStyleBackColor = $true $CheckBox1.UseVisualStyleBackColor = $true
$TabPage3.Controls.Add($CheckBox2)
$TabPage3.Controls.Add($Button15) $TabPage3.Controls.Add($Button15)
$TabPage3.Controls.Add($Button12) $TabPage3.Controls.Add($Button12)
$TabPage3.Controls.Add($Label6) $TabPage3.Controls.Add($Label6)
@ -720,7 +728,7 @@ $FolderBrowserDialog1 = New-Object System.Windows.Forms.FolderBrowserDialog
function fnc_updateBuildNumber($inpath, $outpath, $increment) function fnc_updateBuildNumber($inpath, $outpath, $increment)
{ {
if ($Checkbox1.Checked) if ($Checkbox1.Checked -and $checkbox2.Checked )
{ {
$path = Join-Path $inpath "\build.txt" $path = Join-Path $inpath "\build.txt"
if (Test-Path $path) if (Test-Path $path)
@ -731,7 +739,7 @@ $FolderBrowserDialog1 = New-Object System.Windows.Forms.FolderBrowserDialog
$Out = @( $Out = @(
'build=' + [string]$newBuild + ';' 'build=' + [string]$newBuild + ';'
) )
$Out | Out-File(Join-Path $outpath "\build.hpp") -Encoding "UTF8" $Out | Out-File(Join-Path $outpath "\build.hpp") -Encoding "UTF8"
$newBuild | Out-File $path -Encoding "UTF8" $newBuild | Out-File $path -Encoding "UTF8"
if ($increment -eq 1) if ($increment -eq 1)
@ -922,6 +930,7 @@ $FolderBrowserDialog1 = New-Object System.Windows.Forms.FolderBrowserDialog
$TextBox11.Text $TextBox11.Text
$TextBoxPboPrefix.Text $TextBoxPboPrefix.Text
$TextBoxBISignPrefix.Text $TextBoxBISignPrefix.Text
$CheckBox2.Checked
) )
$Out | Out-File $TextBox5.Text $Out | Out-File $TextBox5.Text
@ -951,6 +960,9 @@ $FolderBrowserDialog1 = New-Object System.Windows.Forms.FolderBrowserDialog
$TextBoxPboPrefix.Text = if ($in[10]) { $in[10] } else { "x\addons" } $TextBoxPboPrefix.Text = if ($in[10]) { $in[10] } else { "x\addons" }
$TextBoxBISignPrefix.Text = if ($in[11]) { $in[11] } else { "epoch" } $TextBoxBISignPrefix.Text = if ($in[11]) { $in[11] } else { "epoch" }
$state = if ($in[12] -eq "True") { $true } else { $false }
$CheckBox2.Checked = $state
} }
else else
@ -1016,10 +1028,13 @@ $FolderBrowserDialog1 = New-Object System.Windows.Forms.FolderBrowserDialog
fnc_updateBuildNumber $TextBox2.Text ($x.subitems[1].Text) $incrementServerBuild fnc_updateBuildNumber $TextBox2.Text ($x.subitems[1].Text) $incrementServerBuild
$incrementServerBuild = 0 $incrementServerBuild = 0
$txt = "Building Server PBO (" + $x.subitems[0].Text + ".pbo) ... Please wait" if ($checkbox2.Checked)
$tree = Join-Path $x.subitems[1].Text "treeView.txt" {
tree /A /F $tmp > $tree $txt = "Building Server PBO (" + $x.subitems[0].Text + ".pbo) ... Please wait"
fnc_pboWriteHostAndTree $txt $tree $tree = Join-Path $x.subitems[1].Text "treeView.txt"
tree / A / F $tmp > $tree
fnc_pboWriteHostAndTree $txt $tree
}
$argz = @($tmp, ( '"' + $Output + '"' ), "-packonly", "-clear", "-prefix=$name", "-project=P:\", "-include=$includes") $argz = @($tmp, ( '"' + $Output + '"' ), "-packonly", "-clear", "-prefix=$name", "-project=P:\", "-include=$includes")
Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Hidden -Wait Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Hidden -Wait
@ -1036,11 +1051,14 @@ $FolderBrowserDialog1 = New-Object System.Windows.Forms.FolderBrowserDialog
if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse } if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse }
Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse Copy-Item -Path $x.subitems[1].Text -Destination $tmp -Recurse
$txt = "Building Client PBO (" + $x.subitems[0].Text + ".pbo) ... Please wait" if ($checkbox2.Checked)
$tree = Join-Path $x.subitems[1].Text "treeView.txt" {
tree /A /F $tmp > $tree $txt = "Building Client PBO (" + $x.subitems[0].Text + ".pbo) ... Please wait"
fnc_pboWriteHostAndTree $txt $tree $tree = Join-Path $x.subitems[1].Text "treeView.txt"
tree / A / F $tmp > $tree
fnc_pboWriteHostAndTree $txt $tree
}
$signFlag = "" $signFlag = ""
if (Test-Path $signfile) { $signFlag = ('-sign="' + $signfile + '"') } if (Test-Path $signfile) { $signFlag = ('-sign="' + $signfile + '"') }
@ -1061,10 +1079,13 @@ $FolderBrowserDialog1 = New-Object System.Windows.Forms.FolderBrowserDialog
Copy-Item($src + "epoch_config") -Destination $tmp -Recurse Copy-Item($src + "epoch_config") -Destination $tmp -Recurse
Copy-Item($src + "description.ext") -Destination $tmp Copy-Item($src + "description.ext") -Destination $tmp
$txt = "Building MPMission PBO (" + $x.subitems[0].Text + ".pbo) ... Please wait" if ($checkbox2.Checked)
$tree = Join-Path $x.subitems[1].Text "treeView.txt" {
tree /A /F $tmp > $tree $txt = "Building MPMission PBO (" + $x.subitems[0].Text + ".pbo) ... Please wait"
fnc_pboWriteHostAndTree $txt $tree $tree = Join-Path $x.subitems[1].Text "treeView.txt"
tree / A / F $tmp > $tree
fnc_pboWriteHostAndTree $txt $tree
}
$argz = @($tmp, ( '"' + $Output + '"' ), "-clear", "-prefix=\", "-project=P:\", "-include=$includes") $argz = @($tmp, ( '"' + $Output + '"' ), "-clear", "-prefix=\", "-project=P:\", "-include=$includes")
Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Hidden -Wait Start-Process -FilePath $Bob -ArgumentList $argz -WindowStyle Hidden -Wait