Unable to run MSI from network path using Process.Start - Is this possible to run an msi from network share?

2

I would like to start an MSI which lives on network share, however the msiexec 'help' dialog shows instead (which indicates something is wrong with the process start info):

string testPath1 = @"\\mynetwork.share.com\dev\builds 1.0\product.msi";  //DOESN'T WORK
string testPath2 = @"C:\users\username\desktop\product.msi";         //DOES WORK

ProcessStartInfo startMsiexecProcess = new ProcessStartInfo(@"C:\windows\system32\msiexec.exe");
startMsiexecProcess.Arguments = @"/i " + testPath1;
Process.Start(startMsiexecProcess);

I have tried variations on the testPath1 - ie not using fully qualified name, and other network shares. I have tried adjusting the spacing on the Arguments, as well.

Finally, if I change the 'local' path to a fully qualified format like this:

string testPath2 = @"\\mylocalmachine.domain.com\c$\users\username\desktop\product.msi";

..it does work correctly. So this gives me confidence that it is likely not a badly formed string causing the issue when I try to execute this on the network share.

Is this possible to run an msi from network share?

JohnZaj

Posted 2013-03-18T04:05:47.280

Reputation: 437

This looks like a better fit on [su] or [sf] – Mike Pennington – 2013-03-23T13:40:36.700

Answers

0

It is the space in my path: "builds 1.0". Process.Start may be interpreting this as an argument delimiter.

To resolve I added quotes around the path to the MSI being run ie:

"\"" + testPath1 + "\""

this post led me to the solution: how-to-handle-values-with-spaces-in-process-start-in-c-sharp

JohnZaj

Posted 2013-03-18T04:05:47.280

Reputation: 437