Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Orca to edit msi from command line?

I'm using Visual Studio 2008 and have created a setup project for my application. The application has a high-resolution icon (for Vista). There's a bug in Visual Studio, and the installer creates a desktop shortcut with a low resolution icon.

I logged this bug in Microsoft Connect (https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=338258) and finally got an answer, which is to use Orca to edit the msi file and replace the icon. That solutions works fine.

Now I want to automate that process, so I can include it in my build script. Is there a way to do that?

like image 518
DanielR Avatar asked May 20 '09 08:05

DanielR


People also ask

How do I modify an MSI file?

Similar to Orca, to edit your MSI package, right-click it and select “Open with Advanced Installer”. Once the MSI database has loaded in Advanced Installer, you will notice a left menu pane where you will find all the options you need to directly edit your MSI.

Can I run MSI from command line?

As a single use solution, you can run the . msi as an administrator from the Windows command prompt. Open elevated Command Prompt. To do so, type "CMD" in Start menu or Start screen search box, and then simultaneously press Ctrl+Shift+Enter keys.

How do I get the Orca MSI editor?

Orca is available from Microsoft as part of the Windows SDK. Once you download and install the SDK, you can copy the Orca. msi installer file from the SDK and save it for future use so you can avoid repeating the Windows SDK download and installation steps.


2 Answers

Possibly the easiest solution that I found for this was to create a new "Transform" inside of Orca, and then to apply the transform as a part of my post-build steps.

1) Open the MSI file using ORCA for editing. 2) Click on "New transform" 3) Make all of the applicable changes to your MSI tables using the Orca editor. 4) Click on "Generate transform", and save the file. 5) Edit your build events to execute msitran during the post-build step. like this...

msitran -a (path to transform file) (path to MSI file)

More information about MSITran.exe can be found at the following location... MSITran

This will automatically apply your edits to the MSI file once your installer build has completed, eliminating the need for custom VBScript.

like image 189
Grizzly Peak Software Avatar answered Sep 21 '22 20:09

Grizzly Peak Software


You can write VBS, JS (using cscript, which is built in with every Windows) to modify the MSI, the syntax is pretty much SQL like. Here is a MSDN page that shows various examples.

like image 42
Shay Erlichmen Avatar answered Sep 21 '22 20:09

Shay Erlichmen