-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
74 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
SpaceWarp.Template/templates/SpaceWarpMod/scripts/setup.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,44 @@ | ||
@echo off | ||
|
||
:: Get the name of the current directory and extract the last folder name | ||
for %%I in (%CD%) do set CURR_DIR_NAME=%%~nxI | ||
|
||
:: Check if the current directory name is "scripts" and change to the parent directory if true | ||
if /i "%CURR_DIR_NAME%"=="scripts" ( | ||
cd .. | ||
) | ||
|
||
:: Inform the user about the PowerShell module check and installation, then wait for a key press to continue | ||
echo The Microsoft.PowerShell.Archive module will be checked for updates due to a bug that affects zipping of mod releases, breaking their CKAN installation. | ||
echo The script will open in a new windows and request administrative privileges if there is a required package update. Please allow it to proceed until it closes itself. | ||
echo Press any key to continue... | ||
pause >nul | ||
|
||
:: Execute the PowerShell script to check and install the necessary module version | ||
powershell -ExecutionPolicy Bypass -File "scripts\setup\check_archive_version.ps1" | ||
|
||
:: Check if the KSP2DIR variable is set, and if it is, skip to the licensing step | ||
if not "%KSP2DIR%" == "" ( | ||
goto license_start | ||
) | ||
|
||
:: Call another batch file to set environment variables | ||
call "scripts\setup\set_env_var.bat" | ||
|
||
:license_start | ||
|
||
:: Call another batch file for licensing | ||
call "scripts\setup\license.bat" | ||
|
||
:: Initialize git for the project | ||
call "scripts\setup\git_init.bat" | ||
|
||
:: Remove the setup scripts directory after the setup is completed | ||
rmdir /s /q "scripts\setup" | ||
|
||
:: Display a message indicating the setup process is finished | ||
echo. | ||
echo Setup is finished. | ||
|
||
:: Delete this batch file after it finishes executing | ||
(goto) 2>nul & del "%~f0" |
4 changes: 4 additions & 0 deletions
4
SpaceWarp.Template/templates/SpaceWarpMod/scripts/setup/check_archive_version.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$module = Get-Module -ListAvailable Microsoft.PowerShell.Archive -ErrorAction SilentlyContinue | Sort-Object Version -Descending | Select-Object -First 1 | ||
if (-not $module -or [version]$module.Version -lt [version]'1.2.3.0') { | ||
Start-Process powershell -ArgumentList 'Install-Module Microsoft.PowerShell.Archive -MinimumVersion 1.2.3.0 -Repository PSGallery -Force; Import-Module Microsoft.PowerShell.Archive' -Verb RunAs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
SpaceWarp.Template/templates/SpaceWarpModEmpty/scripts/setup.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,44 @@ | ||
@echo off | ||
|
||
:: Get the name of the current directory and extract the last folder name | ||
for %%I in (%CD%) do set CURR_DIR_NAME=%%~nxI | ||
|
||
:: Check if the current directory name is "scripts" and change to the parent directory if true | ||
if /i "%CURR_DIR_NAME%"=="scripts" ( | ||
cd .. | ||
) | ||
|
||
:: Inform the user about the PowerShell module check and installation, then wait for a key press to continue | ||
echo The Microsoft.PowerShell.Archive module will be checked for updates due to a bug that affects zipping of mod releases, breaking their CKAN installation. | ||
echo The script will open in a new windows and request administrative privileges if there is a required package update. Please allow it to proceed until it closes itself. | ||
echo Press any key to continue... | ||
pause >nul | ||
|
||
:: Execute the PowerShell script to check and install the necessary module version | ||
powershell -ExecutionPolicy Bypass -File "scripts\setup\check_archive_version.ps1" | ||
|
||
:: Check if the KSP2DIR variable is set, and if it is, skip to the licensing step | ||
if not "%KSP2DIR%" == "" ( | ||
goto license_start | ||
) | ||
|
||
:: Call another batch file to set environment variables | ||
call "scripts\setup\set_env_var.bat" | ||
|
||
:license_start | ||
|
||
:: Call another batch file for licensing | ||
call "scripts\setup\license.bat" | ||
|
||
:: Initialize git for the project | ||
call "scripts\setup\git_init.bat" | ||
|
||
:: Remove the setup scripts directory after the setup is completed | ||
rmdir /s /q "scripts\setup" | ||
|
||
:: Display a message indicating the setup process is finished | ||
echo. | ||
echo Setup is finished. | ||
|
||
:: Delete this batch file after it finishes executing | ||
(goto) 2>nul & del "%~f0" |
4 changes: 4 additions & 0 deletions
4
SpaceWarp.Template/templates/SpaceWarpModEmpty/scripts/setup/check_archive_version.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$module = Get-Module -ListAvailable Microsoft.PowerShell.Archive -ErrorAction SilentlyContinue | Sort-Object Version -Descending | Select-Object -First 1 | ||
if (-not $module -or [version]$module.Version -lt [version]'1.2.3.0') { | ||
Start-Process powershell -ArgumentList 'Install-Module Microsoft.PowerShell.Archive -MinimumVersion 1.2.3.0 -Repository PSGallery -Force; Import-Module Microsoft.PowerShell.Archive' -Verb RunAs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters