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

Projects
None yet
3 participants
@blt04
Contributor

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.

Use escaped quotes for Windows INSTALLDIR
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

Merge pull request #100 from blt04/fix-windows-installdir
Use escaped quotes for Windows INSTALLDIR

@carmstrong carmstrong merged commit 0932484 into sous-chefs:master Dec 12, 2013

@carmstrong

This comment has been minimized.

Contributor

carmstrong commented Dec 12, 2013

Is this the preferred approach, or is #90 ?

@carmstrong

This comment has been minimized.

Contributor

carmstrong commented Dec 12, 2013

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 blt04:fix-windows-installdir branch Dec 17, 2013

@cupcicm

This comment has been minimized.

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

This comment has been minimized.

Contributor

cupcicm commented Jan 23, 2014

OK this is my attempt at fixing it : #131

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment