How can I run msiexec from cygwin to unpack a msi?

5

1

I need to unpack (not execute, unpack) a msi in a cygwin makefile.

If I invoke from the windows command prompt the following

msiexec /a package.msi /qn TARGETDIR=C:\foo

The package is correctly deployed in C:\foo. However, if I try to perform the exact same operation from the cygwin prompt

msiexec /a package.msi /qn TARGETDIR=C:\\foobaz

All I get is the msiexec window stating the usage. I can solve this problem in two ways, either running successfully msiexec as above, or by starting a windows command from the makefile, and have it invoke that operation.

Any ideas?

Stefano Borini

Posted 2014-06-06T15:02:33.140

Reputation: 2 034

You don't need to extract the msi from within cygwin to extract the msi.... – Ramhound – 2014-06-06T15:05:02.933

@Ramhound: I do. The makefile has to unpack the msi somehow. – Stefano Borini – 2014-06-06T15:05:39.890

Does TARGETDIR=/cygdrive/c/foo give better results? – Der Hochstapler – 2014-06-06T15:13:06.733

@OliverSalzburg: nope – Stefano Borini – 2014-06-06T15:13:34.463

Answers

2

Found it. I need to invoke

run msiexec /a package.msi /qn TARGETDIR=C:\\foobaz

in cygwin. I have no idea why, but it works.

Stefano Borini

Posted 2014-06-06T15:02:33.140

Reputation: 2 034

0

I've gone into the same problem, and right after I've seen this, I figured it out by myself that the slashes of the two options (or switches in terms of windows) "/a" and "/qn" should be double slashes "//":

msiexec //a package.msi //qn TARGETDIR=C:\\foobaz

That should work, at least on my machine it does.

Liuxy

Posted 2014-06-06T15:02:33.140

Reputation: 1

0

An msi can be unpacked with most zip utilities, like 7-Zip. It will contain lots of things (like registry keys etc) that are irrelevant in a Linux environment, but you'll be able to get at any text, source or exe's.

jdh

Posted 2014-06-06T15:02:33.140

Reputation: 6 645

Not by cygwin unzip, and I am not going to ask developers to install an additional utility and install it on all test machines. – Stefano Borini – 2014-06-06T15:13:08.683