Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use escaped quotes for Windows INSTALLDIR #100

Merged
merged 1 commit into from
Dec 12, 2013

Conversation

blt04
Copy link
Contributor

@blt04 blt04 commented Dec 12, 2013

When installing Java on Windows, the Java EXE installer expects that the INSTALLDIR variable to contain quotes if there are spaces in the path. This means quotes need to be escaped on the command line. For example, this does not work:

jre-1.7.0_45-windows-x64.exe /s INSTALLDIR="C:\Program Files\java\jre7"

but this does:

jre-1.7.0_45-windows-x64.exe /s INSTALLDIR=\"C:\Program Files\java\jre7\"

I suspect this is because they are passing the arguments as a string to the MSI.

Since the quotes need to be escaped on the command line, they need to be double escaped in Ruby.

The Java .exe installers expect that INSTALLDIR variables containing
spaces be surrounded by quotes *in the variable itself*.  Thus the
command line quotes need to be escaped.  This means we need to double
escape the quotes in Ruby.
carmstrong added a commit that referenced this pull request Dec 12, 2013
Use escaped quotes for Windows INSTALLDIR
@carmstrong carmstrong merged commit 0932484 into sous-chefs:master Dec 12, 2013
@carmstrong
Copy link
Contributor

Is this the preferred approach, or is #90 ?

@carmstrong
Copy link
Contributor

It looks like these are separate issues, but I'd to hear from you Windows folks - should both of these be merged? This fixes install dir, the other cache dir.

@blt04 blt04 deleted the fix-windows-installdir branch December 17, 2013 17:43
@cupcicm
Copy link
Contributor

cupcicm commented Jan 23, 2014

I think that this broke the installation of a JDK with the java cookbook on Windows. I think that this fix works only with a JRE. For example, if I download both a JRE and a JDK here : http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html and here http://java.com/en/download/manual.jsp#win
and then run both

.\jdk-7u51-windows-x64.exe /s INSTALLDIR="C:\java"
and
.\jre-7u51-windows-x64.exe /s INSTALLDIR="C:\java"

The second one works, but the first one doesn't. It does when I remove the backward slashes.
Is there something I can do to fix it ?

@cupcicm
Copy link
Contributor

cupcicm commented Jan 23, 2014

OK this is my attempt at fixing it : #131

@lock
Copy link

lock bot commented May 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants