johanjanssen / TemurinChocolateyPackages

Apache License 2.0
3 stars 4 forks source link

Install dir is overwritten #20

Closed johanjanssen closed 2 years ago

johanjanssen commented 2 years ago

The default install dir is now "Temurin". However, all java versions install into the root of this dir. So they overwrite each other(!!!)

Vankog commented 2 years ago

For whatever reason this was probably some kind of glitch with the scripts: temurin8

PS C:\Users\FOOBAR> choco install Temurin8 --params="/ADDLOCAL=FeatureMain,FeatureEnvironment" -f -y
Chocolatey v0.11.3
Installing the following packages:
Temurin8
By installing, you accept licenses for the packages.
Temurin8 v8.312.700 already installed. Forcing reinstall of version '8.312.700'.
 Please use upgrade if you meant to upgrade to a new version.
Progress: Downloading Temurin8 8.312.700... 100%

Temurin8 v8.312.700 (forced) [Approved]
temurin8 package files install completed. Performing other installation steps.
WARNING: Using Default of C:\Program Files\Temurin
WARNING: Using Addlocal
WARNING: No InstallLevel detected. Defaulting to AddLocal
WARNING: Installing only Get-OSArchitectureWidth
Downloading Temurin8 64 bit
  from 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_windows_hotspot_8u312b07.msi'
Progress: 100% - Completed download of C:\Users\dmoench\AppData\Local\Temp\chocolatey\Temurin8\8.312.700\OpenJDK8U-jdk_x64_windows_hotspot_8u312b07.msi (85.95 MB).
Download of OpenJDK8U-jdk_x64_windows_hotspot_8u312b07.msi (85.95 MB) completed.
Hashes match.
Installing Temurin8...
Temurin8 has been installed.
 The install of temurin8 was successful.
  Software installed to 'C:\Program Files\Temurin\jdk8-hotspot-8.312.7\'

temurin17

PS C:\Users\foobar> choco install Temurin17 --params="/ADDLOCAL=FeatureMain,FeatureEnvironment" -f -y
Chocolatey v0.11.3
Installing the following packages:
Temurin17
By installing, you accept licenses for the packages.
Temurin17 v17.0.1.1200 already installed. Forcing reinstall of version '17.0.1.1200'.
 Please use upgrade if you meant to upgrade to a new version.
Progress: Downloading Temurin17 17.0.1.1200... 100%

Temurin17 v17.0.1.1200 (forced) [Approved]
temurin17 package files install completed. Performing other installation steps.
WARNING: Using Default of C:\Program Files\Temurin
WARNING: Using Addlocal
WARNING: No InstallLevel detected. Defaulting to AddLocal
Downloading Temurin17 64 bit
  from 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_windows_hotspot_17.0.1_12.msi'
Progress: 100% - Completed download of C:\Users\dmoench\AppData\Local\Temp\chocolatey\Temurin17\17.0.1.1200\OpenJDK17U-jdk_x64_windows_hotspot_17.0.1_12.msi (160.73 MB).
Download of OpenJDK17U-jdk_x64_windows_hotspot_17.0.1_12.msi (160.73 MB) completed.
Hashes match.
Installing Temurin17...
Temurin17 has been installed.
 The install of temurin17 was successful.
  Software installed to 'C:\Program Files\Temurin\jdk17-hotspot-17.0.1.12\'

OK... for whatever reason, the issue of them all being installed into the root of "\Temurin" does not appear anymore. I have no idea what went wrong the last time.

johanjanssen commented 2 years ago

Thanks for trying again :). Did you maybe specify the installation directory the last time? If you specify the directory to ...\Temurin for all three versions then I think they all end up directly into that directory. So if you want to specify them, please use version-specific directories like ...\Temurin\11.

Vankog commented 2 years ago

I don't think so. Otherwise, I would not have them installed in \Temurin.

Who knows. I can't reproduce it now.

Vankog commented 2 years ago

New PC, same issue again: choco install Temurin8 --params="/ADDLOCAL=FeatureMain" -y Software installed to 'C:\Program Files\Temurin\ Directly, no sub-folder. INSTALLDIR had no effect in another attempt. Thus, I moved the installation into a sub folder manually.

Then I tried to add choco install Temurin11 --params="/ADDLOCAL=FeatureMain" -y Software installed to 'C:\Program Files\Temurin\ Again, directly, no sub-folder . :-/

johanjanssen commented 2 years ago

As mentioned in https://github.com/johanjanssen/TemurinChocolateyPackages/issues/19#issuecomment-992214853. If I don´t specify arguments, the installation directories were different on my machine.

As mentioned in https://github.com/johanjanssen/TemurinChocolateyPackages/issues/12#issuecomment-700230611, you can specify the installation directory. But then you should also specify the subdirectory. So something like ´/INSTALLDIR=$env:Programfiles\Temurin\Temurin11'.

Vankog commented 2 years ago

Unfortunately, no arguments are not really an option if you install more than one JDK. Otherwise you end up with quite a mess in your environment variables. Especially this gets cumbersome on upgrades.

Further, the second option of providing an install dir, does explicitly not work. Yes, I also tried really specific paths. It always used the default /Temurin.

johanjanssen commented 2 years ago

Sorry but if it doesn´t work, I unfortunately can´t help you with that. I'm no longer using the Chocolatey packages myself and I don´t have a Windows machine available for testing.

Vankog commented 2 years ago

just read https://github.com/johanjanssen/TemurinChocolateyPackages/issues/12#issuecomment-700230611 Are the spaces an issue in my path? I've just used an absolute path like: ´/INSTALLDIR=c:\Program Files\Temurin\foobar'

Im gonna check this tomorrow or so.

If so this would be a great thing to include in the documentation.

RedBaron2 commented 2 years ago

@Vankog please use the %programfiles% variable when you try tomorrow.

johanjanssen commented 2 years ago

@Vankog please let me know if you we're able to solve the issue. I'd happily update the documentation if you have a working solution.

Vankog commented 2 years ago

Tested with JDK 18: %programfiles% did not work. Leading to MSI exit code 1603.

However, $env:Programfiles seems to have done the trick:

PS C:\WINDOWS\system32> choco install Temurin -y --force --params="/ADDLOCAL=FeatureMain /INSTALLDIR=$env:Programfiles\Temurin\jdk18-hotspot-18.0.0.36\"
Chocolatey v1.1.0
Installing the following packages:
Temurin
By installing, you accept licenses for the packages.
Temurin v18.0.0.3600 already installed. Forcing reinstall of version '18.0.0.3600'.
 Please use upgrade if you meant to upgrade to a new version.
Progress: Downloading Temurin 18.0.0.3600... 100%

Temurin v18.0.0.3600 (forced) [Approved]
temurin package files install completed. Performing other installation steps.
WARNING: You must use INSTALLDIR with FeatureMain.
WARNING: Using provided C:\Program Files\Temurin\jdk18-hotspot-18.0.0.36
WARNING: Using Addlocal
WARNING: No InstallLevel detected. Defaulting to AddLocal
WARNING: Installing only Get-OSArchitectureWidth
Downloading Temurin 64 bit
  from 'https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18%2B36/OpenJDK18U-jdk_x64_windows_hotspot_18_36.msi'
Progress: 100% - Completed download of C:\Users\dmoench\AppData\Local\Temp\chocolatey\Temurin\18.0.0.3600\OpenJDK18U-jdk_x64_windows_hotspot_18_36.msi (161.58 MB).
Download of OpenJDK18U-jdk_x64_windows_hotspot_18_36.msi (161.58 MB) completed.
Hashes match.
Installing Temurin...
Temurin has been installed.
  temurin may be able to be automatically uninstalled.
 The install of temurin was successful.
  Software installed to 'C:\Program Files\Temurin\jdk18-hotspot-18.0.0.36\'
johanjanssen commented 2 years ago

Nice that it works and thanks a lot for confirming. I've updated the documentation: #e8d7195c235274aa2cef2c3e5793c2c555034a81

Apologies for the inconvenience!