Skip to content

Commit 88f9517

Browse files
Fixed install-dir as argument to the Robocode command-line and made it possible to specify a \InstallDir parameter as well for the Chocolatey install script.
1 parent 42196e6 commit 88f9517

File tree

5 files changed

+12
-19
lines changed

5 files changed

+12
-19
lines changed

robocode.installer/build.gradle.kts

+1-6
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,7 @@ tasks {
105105
task<Exec>("chocoBuild") {
106106
dependsOn("chocoCopy")
107107
workingDir = file("build/choco")
108-
doFirst {
109-
commandLine("choco", "pack", "--version", "${project.version}", "--skipautouninstaller")
110-
}
111-
doLast {
112-
delete("build/choco/tools/chocolateyuninstall.ps1") // should be omitted from the package (moderation)
113-
}
108+
commandLine("choco", "pack", "--version", "${project.version}")
114109
}
115110

116111
task<Exec>("chocoPush") {

robocode.installer/src/chocolatey/tools/VERIFICATION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ VERIFYING CHECKSUM CONTENT
1717

1818
3. Verify that checksum is:
1919

20-
759A37C34B18EB6BD3B54B7FD4579F0F23451A48B32614868FA48DABBFFD41F1
20+
42B45FA86538009DA0CF3151A520A111610E055967143D1A17B6BF150707C043
2121

2222

2323
VERIFYING LICENCE
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
$ErrorActionPreference = 'Stop';
2-
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
3-
# Get-ChocolateyUnzip -FileFullPath "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\\robocode-*-setup.jar" -Destination "C:\robocode"
4-
Start-ChocolateyProcessAsAdmin -Statements "java -jar $(Split-Path -Parent $MyInvocation.MyCommand.Definition)\robocode-$env:ChocolateyPackageVersion-setup.jar C:\robocode\ silent"
2+
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
3+
4+
$params = Get-PackageParameters
5+
if (!$params['InstallDir']) { $params['InstallDir'] = "$env:SystemDrive\Robocode" }
6+
7+
Start-ChocolateyProcessAsAdmin -Statements "java -jar $(Split-Path -Parent $MyInvocation.MyCommand.Definition)\robocode-$env:ChocolateyPackageVersion-setup.jar $($params['InstallDir']) silent"

robocode.installer/src/chocolatey/tools/chocolateyuninstall.ps1

-4
This file was deleted.

robocode.installer/src/main/java/net/sf/robocode/installer/AutoExtract.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,16 @@ private boolean extract(File installDir) {
324324

325325
public static void main(String[] argv) {
326326
String suggestedDirName;
327-
if (argv.length == 1) {
327+
if (argv.length >= 1) {
328328
suggestedDirName = argv[0];
329329
} else if (isWindowsOS()) {
330-
suggestedDirName = "C:\\robocode\\";
330+
suggestedDirName = System.getenv("SystemDrive") + ":\\robocode";
331331
} else {
332332
suggestedDirName = System.getProperty("user.home") + File.separator + "robocode" + File.separator;
333333
}
334-
if (argv.length >= 1 && "silent".equals(argv[1])) {
334+
if (argv.length >= 2 && "silent".equals(argv[1])) {
335335
isSilent = true;
336-
}
337-
else if (GraphicsEnvironment.isHeadless()) {
336+
} else if (GraphicsEnvironment.isHeadless()) {
338337
isSilent = true;
339338
}
340339

0 commit comments

Comments
 (0)