How to exclude component installation in an MSI? - windows

SCENARIO
I've downloaded this application: http://www.babelsoft.net/bin/MediaPreviewSetup-1.4.3.429.sfx.exe
The setup is an SFX-Rar that contains an MSI installer, and I would like to write an script to install the MSI silentlly.
PROBLEM
The installer comes with 3 components
Shell Extension for Video
Shell Extension for Audio
Shell Extension for Image
Plus these two components:
configuration Tool
DesktopShortcut
But I only want to install the shell extension for Video together with the configuration Tool.
So I've checked the MSI table to see the component names with the MSI Explorer tool
But when I try to run the installer it throws an error code 2711
MediaPreviewSetup-64-1.4.3.429.msi ADDLOCAL=ProductComponent64,ToolComponent
QUESTION
What I'm doing wrong?
What are the right MSI parametters that I should use when to install only the desired components?
Thanks in advance

Error 2711 is because the ADDLOCAL property expects a list of feature names not component names. You'll need to create a transform and apply it with TRANSFORMS=foo.mst to exclude just a component from the installation.

Related

Change the value of a MSI property loaded from a DLL using a MSI transform

I need to modify the installation behavior of a MSI setup for "IBM i Access for Windows". The setup was created using InstallShield. During the installation the setup triggers two other MSI installations through "chaining". The parameters passed to MSIEXEC.EXE to execute those two installations get loaded by a custom action from a DLL that is included with the installation. The parameters end up in a MSI property.
I want to change the value in that property to manipulate the command line before the chained installation gets launched. Is this possible? If so, how? I have no problem to create an external DLL that reads and modifies the property, but I am at a loss on how to integrate this with the existing installation -- which tables do I have to modify and how, where should I put the DLL, ...
EDIT 1: To clarify this: I want to modify the parameters passed to the chained MSI installations. They are independent from the parameters I pass to the main installation and are loaded from a DLL that is part of the installation.
EDIT 2: I have uploaded the plain MSI + the relevant log file. I start the main installation with "/qn" to suppress all messages. That works without problems, the chained installations get executed without visible prompts. The problem arises when uninstalling the software (again with "/qn"). The remote custom action gets loaded from a DLL (line 6417):
MSI (s) (10:28) [09:00:45:643]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIA4BD.tmp, Entrypoint: ISChainPackages
The command line loaded from the DLL specifies to call MSIEXEC.EXE with the parameter "/qb" instead of "/qn" (line 6958):
MSI (s) (10!60) [09:00:46:033]: PROPERTY CHANGE: Adding IS_CHAINER_POST_COMMANDLINE property. Its value is '/l"c:\temp\IBM_iAccess_7.1_Uninstall.log" /qb /x{CCA40632-843E-48C6-B14F-E1070015D87C} ...
And because the MSI installer has a lock on a file a messagebox pops up triggered by the uninstallation of the chained MSI (line 44046):
MSI (s) (10:C0) [09:01:05:553]: RESTART MANAGER: Did detect that the custom action server with process ID 2352 holds file[s] in use, so a reboot will be necessary.
MSI (s) (10:C0) [09:01:05:553]: Note: 1: 1610
MSI (s) (10:C0) [09:01:11:224]: RESTART MANAGER: The user chose to go on with the installation, although a reboot will be required.
The setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required to complete the setup.
The installation files for version 7.1 of this software are no longer available on the IBM website. Only the current version is, and I have not looked into whether the problem still exists with the latest version or not as I have been asked to package v7.1 by the business department.
One approach to this problem would be to create a new Custom Action that executes VBScript code stored in the Binary Table and place the new Custom Action right after ISChainPackagePrepare. The VBScript code will read the value of IS_CHAINER_POST_COMMANDLINE and replace it as specified in the Replace() function
The VBScript Code could look like this:
Option Explicit
Function ReplacePropVal()
dim propvalue
dim newvalue
propvalue = Session.Property("IS_CHAINER_POST_COMMANDLINE")
newvalue = Replace(propvalue,"/qb","/qn")
Session.Property("IS_CHAINER_POST_COMMANDLINE") = newvalue
End Function
You want to give your new Custom Action a Type of 6 to indicate that your Custom Action data is stored as a VBScript in the Binary table. Your Custom Action Source is a reference to the Name in the Binary Table. The Target value of your Custom Action will need to be the name of the VBScript Function which is ReplacePropVal in this case
Afterwards, you place your new Custom Action in the InstallExecutionSequence table using the same name for it as in the CustomAction table. Also make sure to give it a higher Sequence value as ISChainPackagePrepare. I would recommend placing it right after by incrementing the Sequence value of ISChainPackagePrepare by 1.
After you've changed the tables and generated a new transform, just run the package with the new transform being applied by specifying its path in the TRANSFORMS public property and your property value should be changed.
I think the ideal approach here would be to transform the chained package definition. The UI level (documentation) is stored in the first two bits of the Options column of the ISChainPackage table, so all your transform should have to do is alter that value. In particular, you can change those bits from ecoUIBasic (0) to ecoUINone (1), which should be as simple as adding 1 to the current value. Also available are ecoUIReduced (2) and ecoUIFull (3).
If ISChainPackage.Options is altered correctly, the desired IS_CHAINER_POST_COMMANDLINE will be generated for you, and you won't have to add a secondary custom action to alter the /qb to /qn afterward. (Kudos to sevi for suggesting that functional workaround.)
If this is an Advanced or Suite UI Setup.exe, please check that
link for how to pass a property.
Package Database Entries (Software Re-Packaging tips for iAccess and other software):
https://www.itninja.com/company/browse/i - look at the IBM entries
IBM i Access for Windows
IBM iAccess for Windows 7.1
How to perform silent upgrade for IBM I Access for Windows 7.1?
Making a silent package for IBM i Access for Windows 7.1 with latest patch
Approaches: What does this DLL custom action do? Does it create a license key? Often these things have been found and solved many times before. To check for this, I usually use these approaches to find solutions:
File Extraction: try extracting files from the setup and look for help files that describe proper deployment. "Large Scale Deployment.chm", "Installation Command Line Parameters.chm", etc... or ready-made transforms or command line file samples (Install.cmd).
Deployment Sites: Check https://www.itninja.com/company/browse/i (Software Re-Packaging tips - look at the IBM entries. Several entries that look relevant, here is one).
Forums: inspect their support forums or online support - if available.
Phone: get on the phone with the vendor. Sometimes very helpful, often a waste of time. Ask for deployment relevant information sent from support. Do this if you have a support agreement?
See section on file extraction below.
Setup.exe Switches: I have a similar or related answer here, where I also mention setup.exe command line switches: Silent run installer (.exe) with parameters on Windows.
Logging: If the custom action does not create something dynamic (unique license key, machine locking identity, etc...), then you can try to find what was generated by logging the setup and looking for the command line used in the log file. Mock-up sample:
MSI (s) (AC:00) [00:00:00:00]: Command Line: TARGETDIR=C:\ SHORTCUTDIR=C:\Documents and Settings\All Users\Start Menu\Programs\Test ACTION=INSTALL
File Extraction: Is this an Installshield Suite project? did you extract the embedded files and MSI files first?: Programmatically extract contents of InstallShield setup.exe.
What is in a Setup.exe?: Installshield setup.exe files can be lots of different things (explanation of different setup.exe flavors): Regarding silent installation using Setup.exe generated using Installshield 2013 (.issuite) project file.
Links:
Extract MSI from EXE
What is the purpose of administrative installation initiated using msiexec /a?

Is it possible to detect if help file is contained in the setup file (msi or exe)?

I would like to know how can I detect if help file is contained in setup file for windows platform application (msi or exe). Is there any method to get this information without installing the software first ?
Of course setup file can be created by many setup makers like innosetup, installshield and so on. So I wonder if there is some universal method to solve this.
For an MSI based install it would be very easy. For example you can use the Microsoft.Deployment.WindowsInstaller interop via C# to open the MSI as an InstallPackageClass then access it's Files collection to see if it contains the file you care about.
For a Non-MSI based install, there is no universal way and in most cases, no way period. See, that's kind of the point of MSI: to have a standards based package rich in meta data to be able to see what it's doing. When you do some proprietary script driven installer you lose that openness.
If it's a MSI file, open it up using Orca, and you can view file names.
For both of them, you should be able to do an administrative install, which would extract the files, but not register anything. Depending on where the exe came from, doing an administrative install changes, since each vendor(installshield, innosetup, etc) has their own way to run an administrative install.
for a MSI it's simply
msiexec /a <msi_filename>
For an exe you'll have to look up how to pass the /a argument.

VS setup wizard impairment - maybe an alternative to it?

Is Visual Studio's Setup Wizard project able to only deploy some of the files only if it finds a certain key into the registry (a) ? If not, then maybe launch another installer file when that certain reg key is present (b) ?
(a) I have been trying to deploy a winamp plugin through VS's .msi files. 2 problems:
the path to {winamp}/plugins folder has to be obtained automatically
on failure, user should be presented with a dialog to choose where to install the plugin to
(b) In an attempt to overcome (a) the NSIS installer was used for only packaging the winamp .dll plugin; however, this introduced another issue:
if user does not have winamp installed, the NSIS generated sub-installer must be manually canceled, and this invariably causes the main VS generated installer to fail (while it shoud not, winamp is not an essential part of the good functionning of the whole app I am deploying)
I have failed in 2 ways to conditionally launch the sub-installer on a certain reg key detection (tried to look for the ProgID key of Winamp). First failure was because the ProgID key is not found even on machines that do have winamp installed (manually checked for the key, it was there), and second failure was due to the fat that such conditional launch could not be applied to just the sub-installer, but to the main installer only.
I am thinking of dumping the VS project wizard altogether and just move to NSIS installer wizard.. but I would not want to learn to script it for deploying each component of my solution. Any GUI version for it ? Or should I start learning Orca and use it on the VSPW's output .msi file ? Or what ?
Thanks
If you want to use a MSI the approach is this:
- create a search for the registry entry
- use the search result (it's stored in an installer property) to condition the components of your files
- use the same result to condition the installation folder dialog
This can easily be done in commercial setup tools. But if you want a free solution, Sandeep is right, Wix is very good.

How to embedded msi into a setup.exe and execute it silently?

Here's the requirement:
1. One single installation file. (aka. setup.exe) All the other files include the required dlls and msi itself must embedded in this setup.exe.
2. Frameless UI, which the pure msi doesn't support.
Firstly, we are using pure msi to provide the installation GUI, but then we found it's not support the frameless GUI. So we want to keep the single file and make our own frameless GUI.
Anyone has any ideas?
You'll need to impliment an external UI handler.
You might find some of the links on http://blogs.msdn.com/windows_installer_team/archive/2005/07/23/442584.aspx as a helpful starting point.

single installation experience for application and bootstrapper in wix

hii,
i made a bootstrapper for my msi to check and install the prerequisites..and when i click the
setup.exe file it smoothly check and install..there is no problem in it..
*)For now i use GenerateBootstrapper and bootstrapperFile to create bootstrapper.
But my problem is this that when the prerequisite are installed they use there own install window.but i want to provide single installation feel..
i want to run every prerequisite file in my own customized UI ..
i want to customize the Ui of them.How can i do this?? can anyone help me out??
thanks.
as far as I can tell currently there is no way of doing it with wix only.
Butwix3.5 should contain sth called Burn http://robmensching.com/blog/posts/2009/7/14/Lets-talk-about-Burn

Resources