diff --git a/DCS_Afgainistan/Insurgent_Sandstorm/F99th-Insurgent_Sandstorm_1.2.8.miz b/DCS_Afgainistan/Insurgent_Sandstorm/F99th-Insurgent_Sandstorm_1.2.8.miz new file mode 100644 index 0000000..581bf10 Binary files /dev/null and b/DCS_Afgainistan/Insurgent_Sandstorm/F99th-Insurgent_Sandstorm_1.2.8.miz differ diff --git a/DCS_Caucasus/F99th-AirWar/F99th-TheAirWar-1.0.2.miz b/DCS_Caucasus/F99th-AirWar/F99th-TheAirWar-1.0.2.miz new file mode 100644 index 0000000..f273b06 Binary files /dev/null and b/DCS_Caucasus/F99th-AirWar/F99th-TheAirWar-1.0.2.miz differ diff --git a/DCS_Caucasus/F99th-Battle of Gori/F99th-The Battle of Gori 1.7.miz b/DCS_Caucasus/F99th-Battle of Gori/F99th-The Battle of Gori 1.7.miz new file mode 100644 index 0000000..b3bf58e Binary files /dev/null and b/DCS_Caucasus/F99th-Battle of Gori/F99th-The Battle of Gori 1.7.miz differ diff --git a/DCS_Caucasus/F99th-Bunker Busting/F99th-Bunker Busting 2.0.1 - TRAINING-1.0.1.miz b/DCS_Caucasus/F99th-Bunker Busting/F99th-Bunker Busting 2.0.1 - TRAINING-1.0.1.miz new file mode 100644 index 0000000..6ca891b Binary files /dev/null and b/DCS_Caucasus/F99th-Bunker Busting/F99th-Bunker Busting 2.0.1 - TRAINING-1.0.1.miz differ diff --git a/DCS_Caucasus/F99th-Iron Hand/DSMC-Iron_Hand_1.6.miz b/DCS_Caucasus/F99th-Iron Hand/DSMC-Iron_Hand_1.6.miz new file mode 100644 index 0000000..d2ffe4b Binary files /dev/null and b/DCS_Caucasus/F99th-Iron Hand/DSMC-Iron_Hand_1.6.miz differ diff --git a/DCS_Caucasus/F99th-Operation Black Gold/F99th-Operation Black Gold 3.0.2.miz b/DCS_Caucasus/F99th-Operation Black Gold/F99th-Operation Black Gold 3.0.2.miz new file mode 100644 index 0000000..df92ab7 Binary files /dev/null and b/DCS_Caucasus/F99th-Operation Black Gold/F99th-Operation Black Gold 3.0.2.miz differ diff --git a/DCS_Caucasus/F99th-Search and Rescue in Khashuri 1.2.4/F99th-Search and Rescue in Khashuri 1.2.7.miz b/DCS_Caucasus/F99th-Search and Rescue in Khashuri 1.2.4/F99th-Search and Rescue in Khashuri 1.2.7.miz new file mode 100644 index 0000000..006895f Binary files /dev/null and b/DCS_Caucasus/F99th-Search and Rescue in Khashuri 1.2.4/F99th-Search and Rescue in Khashuri 1.2.7.miz differ diff --git a/DCS_Caucasus/F99th-Training Day/F99th-Training_Day_1.0.8.miz b/DCS_Caucasus/F99th-Training Day/F99th-Training_Day_1.0.8.miz new file mode 100644 index 0000000..26ad2c1 Binary files /dev/null and b/DCS_Caucasus/F99th-Training Day/F99th-Training_Day_1.0.8.miz differ diff --git a/DCS_Falklands/Siege of Ushuaia/F99th-Siege of Ushuaia-1.4.4.miz b/DCS_Falklands/Siege of Ushuaia/F99th-Siege of Ushuaia-1.4.4.miz new file mode 100644 index 0000000..6237089 Binary files /dev/null and b/DCS_Falklands/Siege of Ushuaia/F99th-Siege of Ushuaia-1.4.4.miz differ diff --git a/DCS_Kola/Operation_Polar_Shield/F99th-Operation_Polar_Shield_1.1.4.miz b/DCS_Kola/Operation_Polar_Shield/F99th-Operation_Polar_Shield_1.1.4.miz new file mode 100644 index 0000000..195f3c9 Binary files /dev/null and b/DCS_Kola/Operation_Polar_Shield/F99th-Operation_Polar_Shield_1.1.4.miz differ diff --git a/DCS_Kola/Operation_Polar_Shield/F99th-Operation_Polar_Shield_1.1.5.miz b/DCS_Kola/Operation_Polar_Shield/F99th-Operation_Polar_Shield_1.1.5.miz new file mode 100644 index 0000000..195f3c9 Binary files /dev/null and b/DCS_Kola/Operation_Polar_Shield/F99th-Operation_Polar_Shield_1.1.5.miz differ diff --git a/DCS_Marianas/Island Capture/Battle of Marianas 1.1.9.miz b/DCS_Marianas/Island Capture/Battle of Marianas 1.1.9.miz new file mode 100644 index 0000000..6581b41 Binary files /dev/null and b/DCS_Marianas/Island Capture/Battle of Marianas 1.1.9.miz differ diff --git a/DCS_Sinai/Battle for Gaza/F99th-Battle for Gaza.1.2.1.miz b/DCS_Sinai/Battle for Gaza/F99th-Battle for Gaza.1.2.1.miz new file mode 100644 index 0000000..072f1d2 Binary files /dev/null and b/DCS_Sinai/Battle for Gaza/F99th-Battle for Gaza.1.2.1.miz differ diff --git a/DCS_Syria/Battle for Rayak Valley/F99th-Battle for Rayak Valley-1.0.8.miz b/DCS_Syria/Battle for Rayak Valley/F99th-Battle for Rayak Valley-1.0.8.miz new file mode 100644 index 0000000..f934681 Binary files /dev/null and b/DCS_Syria/Battle for Rayak Valley/F99th-Battle for Rayak Valley-1.0.8.miz differ diff --git a/DCS_Syria/Battle of Ramat/Battle of Ramat-1.0.1.miz b/DCS_Syria/Battle of Ramat/Battle of Ramat-1.0.1.miz new file mode 100644 index 0000000..b94d246 Binary files /dev/null and b/DCS_Syria/Battle of Ramat/Battle of Ramat-1.0.1.miz differ diff --git a/DCS_Syria/Ermenek Liberation/Ermenek Liberation 1.2.6.miz b/DCS_Syria/Ermenek Liberation/Ermenek Liberation 1.2.6.miz new file mode 100644 index 0000000..88d7ba3 Binary files /dev/null and b/DCS_Syria/Ermenek Liberation/Ermenek Liberation 1.2.6.miz differ diff --git a/DCS_Syria/Haifa Siege/Haifa Siege-1.0.1.miz b/DCS_Syria/Haifa Siege/Haifa Siege-1.0.1.miz new file mode 100644 index 0000000..325093e Binary files /dev/null and b/DCS_Syria/Haifa Siege/Haifa Siege-1.0.1.miz differ diff --git a/DCS_Syria/Operation Ronin-Syria/F99th-Operation Ronin-Syria 1.1.miz b/DCS_Syria/Operation Ronin-Syria/F99th-Operation Ronin-Syria 1.1.miz new file mode 100644 index 0000000..21668e2 Binary files /dev/null and b/DCS_Syria/Operation Ronin-Syria/F99th-Operation Ronin-Syria 1.1.miz differ diff --git a/DCS_Syria/Operation Sandman/F99th-Operation Sandman-MODS-1.0.10.miz b/DCS_Syria/Operation Sandman/F99th-Operation Sandman-MODS-1.0.10.miz new file mode 100644 index 0000000..9d92acd Binary files /dev/null and b/DCS_Syria/Operation Sandman/F99th-Operation Sandman-MODS-1.0.10.miz differ diff --git a/Patch-MooseMissions/Patch-MyMooseMissions.ps1 b/Patch-MooseMissions/Patch-MyMooseMissions.ps1 index de4d038..7c74a26 100644 --- a/Patch-MooseMissions/Patch-MyMooseMissions.ps1 +++ b/Patch-MooseMissions/Patch-MyMooseMissions.ps1 @@ -25,14 +25,14 @@ .EXAMPLE .\Patch-MyMooseMissions.ps1 - Processes all missions in C:\DCS_MissionDev using the default Moose_.lua + Shows what missions would be processed (WhatIf mode - no changes made) .EXAMPLE - .\Patch-MyMooseMissions.ps1 -WhatIf - Shows what missions would be processed without making any changes + .\Patch-MyMooseMissions.ps1 -Force + Actually patches all missions with the latest Moose_.lua .EXAMPLE - .\Patch-MyMooseMissions.ps1 -ExcludeTerrain @("DCS_Normandy", "DCS_Falklands") + .\Patch-MyMooseMissions.ps1 -Force -ExcludeTerrain @("DCS_Normandy", "DCS_Falklands") Processes all missions except those in Normandy and Falklands terrains .NOTES @@ -41,7 +41,7 @@ Requires: Patch-MooseMissions.ps1 in the same directory #> -[CmdletBinding(SupportsShouldProcess)] +[CmdletBinding()] param( [Parameter(Mandatory=$false)] [string]$RootPath = "C:\DCS_MissionDev", @@ -50,20 +50,32 @@ param( [string]$MooseLuaPath = "C:\DCS_MissionDev\Moose_.lua", [Parameter(Mandatory=$false)] - [string[]]$ExcludeTerrain = @() + [string[]]$ExcludeTerrain = @(), + + [Parameter(Mandatory=$false)] + [switch]$Force ) +Clear-Host + +# Enable WhatIf mode by default unless -Force is specified +$runInWhatIfMode = -not $Force + +if ($runInWhatIfMode) { + Write-Host "========================================" -ForegroundColor Magenta + Write-Host "RUNNING IN WHATIF MODE (Preview Only)" -ForegroundColor Magenta + Write-Host "No files will be modified" -ForegroundColor Magenta + Write-Host "Use -Force parameter to actually patch missions" -ForegroundColor Magenta + Write-Host "========================================" -ForegroundColor Magenta + Write-Host "" +} + # Verify paths exist if (-not (Test-Path $RootPath)) { Write-Error "Root path not found: $RootPath" exit 1 } -if (-not (Test-Path $MooseLuaPath)) { - Write-Error "Moose_.lua file not found: $MooseLuaPath" - exit 1 -} - # Verify the Patch-MooseMissions.ps1 script exists $patchScriptPath = Join-Path $PSScriptRoot "Patch-MooseMissions.ps1" if (-not (Test-Path $patchScriptPath)) { @@ -82,6 +94,60 @@ if ($ExcludeTerrain.Count -gt 0) { } Write-Host "" +# Download latest Moose_.lua from GitHub +if (-not $runInWhatIfMode) { + Write-Host "Downloading latest Moose_.lua from GitHub..." -ForegroundColor Yellow + + $mooseGitHubUrl = "https://raw.githubusercontent.com/FlightControl-Master/MOOSE_INCLUDE/develop/Moose_Include_Static/Moose_.lua" + $backupPath = "$MooseLuaPath.backup" + + try { + # Create a single backup of existing Moose_.lua if it exists and backup doesn't exist yet + if ((Test-Path $MooseLuaPath) -and -not (Test-Path $backupPath)) { + Write-Host " Creating backup: $backupPath" -ForegroundColor Gray + Copy-Item $MooseLuaPath $backupPath -Force + } + + # Download the file + $ProgressPreference = 'SilentlyContinue' # Speeds up Invoke-WebRequest + Invoke-WebRequest -Uri $mooseGitHubUrl -OutFile $MooseLuaPath -ErrorAction Stop + $ProgressPreference = 'Continue' + + # Verify the download + if (Test-Path $MooseLuaPath) { + $fileSize = (Get-Item $MooseLuaPath).Length + Write-Host " SUCCESS: Downloaded Moose_.lua ($([math]::Round($fileSize/1MB, 2)) MB)" -ForegroundColor Green + } else { + throw "Downloaded file not found after download" + } + } + catch { + Write-Error "Failed to download Moose_.lua from GitHub: $_" + Write-Host " URL: $mooseGitHubUrl" -ForegroundColor Red + + # Check if we have a backup or existing file to use + if (Test-Path $MooseLuaPath) { + Write-Warning "Using existing Moose_.lua file instead" + } else { + Write-Error "No Moose_.lua file available. Cannot proceed." + exit 1 + } + } + + Write-Host "" +} else { + Write-Host "WHATIF: Would download latest Moose_.lua from GitHub" -ForegroundColor Magenta + Write-Host " URL: https://raw.githubusercontent.com/FlightControl-Master/MOOSE_INCLUDE/develop/Moose_Include_Static/Moose_.lua" -ForegroundColor Gray + Write-Host " Destination: $MooseLuaPath" -ForegroundColor Gray + + # Still need to verify file exists for WhatIf to show what would be patched + if (-not (Test-Path $MooseLuaPath)) { + Write-Warning "Moose_.lua not found at $MooseLuaPath - run with -Force to download it" + Write-Warning "Continuing with WhatIf to show which missions would be processed..." + } + Write-Host "" +} + # Function to parse version number from filename function Get-VersionNumber { param([string]$FileName) @@ -235,7 +301,7 @@ foreach ($terrainFolder in $terrainFolders) { Write-Host "$($latestMission.Name)" -ForegroundColor Yellow # Execute the patch script - if ($PSCmdlet.ShouldProcess($latestMission.FullName, "Patch with Moose_.lua")) { + if (-not $runInWhatIfMode) { try { # Call Patch-MooseMissions.ps1 & $patchScriptPath -MissionPath $latestMission.FullName -LuaScriptPath $MooseLuaPath -ErrorAction Stop @@ -253,7 +319,7 @@ foreach ($terrainFolder in $terrainFolders) { } } else { - Write-Host " WHATIF: Would patch this mission" -ForegroundColor Magenta + Write-Host " WHATIF: Would patch this mission with Moose_.lua" -ForegroundColor Magenta } } @@ -275,8 +341,9 @@ if ($totalMissionsFailed -gt 0) { } Write-Host "" -if ($WhatIfPreference) { +if ($runInWhatIfMode) { Write-Host "INFO: This was a WhatIf run - no files were modified" -ForegroundColor Magenta + Write-Host "INFO: Run with -Force parameter to actually patch missions" -ForegroundColor Magenta } elseif ($totalMissionsPatched -gt 0) { Write-Host "SUCCESS: All missions have been patched with the latest Moose framework!" -ForegroundColor Green Write-Host "TIP: Test your patched missions in DCS before deployment!" -ForegroundColor Yellow