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?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With