Windows Installer Troubleshooting Tips from Last Week of October

Question 1

Any tips troubleshooting silent install exiting with error 1618?

Answer 1

Start with the Windows Installer SDK.

First, search for “windows installer” 1618 which turns up Initialization Errors [Windows Installer] as the sixth hit.

When you look at this page you’ll see

ERROR_INSTALL_ALREADY_RUNNING 1618 An installation is already in progress

Second, have a look at your event log and look for the messages per the MSDN Topic Event Logging.

When one puts this information together, the chances are high something else is triggering a silent install of a MSI based product thus the mutex is preventing the simultaneous install of the second product.

Question 2

Can you help me troubleshoot my component states?

I have a shared component Component_Perf. It is shared between A.msi and B.msi.

Install A.msi

MSI (s) (68:30) [11:46:28:449]: Component: Component_Perf; Installed: Absent; Request: Local; Action: Local

Install B.msi

MSI (s) (68:50) [11:50:03:096]: Component: Component_Perf; Installed: Absent; Request: Local; Action: Local

Since the component is already installed with A.msi, I was expecting this be Action: Null? Specifically

Install B.msi

Installed: Local; Request: Local; Action: Null

The behavior seems as expected during uninstallation.

Uninstall B.msi

MSI (s) (68:A8) [12:02:01:415]: Component: Component_Perf; Installed: Local; Request: Absent; Action: Null

Uninstall A.msi

MSI (s) (68:74) [12:06:18:157]: Component: Component_Perf; Installed: Local; Request: Absent; Action: Absent

What am I missing?

Answer 2

You still have to install the component for Product B. Note that it shows up as "Installed: Absent" because it's not currently installed. The real question is why do you expect the Action state to be Null? Unless there's a higher version of the component on the machine, it's already installed for Product B, or it's condition evaluates to false, the Action state of Local makes sense.

So essentially Installed = Installed for Product and not Installed on Computer.

Question 3

Is there a way I can achieve the following Custom Action calls using Windows Installer without implementing my own detection mechanism?

  1. Execute CA_Install with the first installed product that includes Component_Perf
  2. Execute CA_Remove with the last removed product that includes Component_Perf

Answer 3

There is an API called MsiEnumClients that gives you client lists of a component. If you're only dealing with per-machine installs, it's an easy API that'll work for you.

Question 4

I want to make a script that adds to the order a constant, to every line in the controlEvent table which has a “Spawndialog” value. There may be more than one such line in every dialog. How can I write a SQL query that updates these lines?

Answer 4

SQL Syntax [Windows Installer] says

Modify existing records in a table UPDATE {table-list} SET {column}= {constant} [, {column}= {constant}][, ...] [WHERE {operation-list}] UPDATE queries only work on nonprimary key columns.

Examples of Database Queries Using SQL and Script says

Modify an existing record in a table

The following command line changes the existing value in the Title field to "Performances." The updated record has "Arts" as its primary key and is in the Feature table of the Test.msi database.

Cscript WiRunSQL.vbs Test.msi "UPDATE `Feature` SET `Feature`.`Title`='Performances' WHERE `Feature`.`Feature`='Arts'"

Addition however is not part of the subset of SQL Syntax that Windows Installer supports. The way I’ve solved this in the past is to start with the Working with Queries MSDN Topic and between steps 3 and 4, I run MsiRecordGetInteger, do the math, and run MsiRecoredSetInteger.

Question 5

Is there any way to force the components to reload without doing a major upgrade?

Answer 5

No. Please review MSDN Topic Patching and Upgrades, specifically the table at the end of the topic. Given what I understand of this case, this question asks for Major Upgrade behavior in a Small Update which is not possible. Also note: Minor Upgrade does not apply because this functionally wants to reorganize the Feature-Component tree which is not allowed in a minor upgrade.

Question 6

Any thoughts on causing the files to reinstall to the target directory?

Answer 6

I think this asks “can I change the target path during maintenance mode?” to which the answer is ‘No’ per MSDN topic Changing the Target Location for a Directory

Question 7

Can you provide assistance troubleshooting error 1334?

I generated a patch and upon applying that patch received this error:

 Error 1334. The file 'Indexes.cmp.751F2241_A570_4290_8C69_419C00462AA5' cannot be installed because the file cannot be found in cabinet file 'Product.cab'. This could indicate a network error, an error reading from the CD-ROM, or a problem with this package.

MSI (s) (9C:C4) [13:26:07:755]: Product: Division-Product 9.0 -- Error 1334. The file 'Indexes.cmp.751F2241_A570_4290_8C69_419C00462AA5' cannot be installed because the file cannot be found in cabinet file 'Product.cab'. This could indicate a network error, an error reading from the CD-ROM, or a problem with this package.

So I looked in the SDK for don’t do’s of creating a patch package. Everything I was able to verify as not a problem except for “do not change the order of files in a cabinet”…. When I investigated that one, here’s what I had in my base MSI:

386 PreLoad.cmp 16 \Program Files\Division\Product\SQL\Install\1157\Company\Data\
387 Indexes.cmp 7817 \Program Files\Division\Product\SQL\Install\2416\Company\
388 Tables.cmp 19842 \Program Files\Division\Product\SQL\Install\2416\Company\
389 Driver.ini 358 \Program Files\Division\Product\SQL\Install\2416\
390 DexProcs.cmp 302470 \Program Files\Division\Product\SQL\Install\2416\Company\
391 DexProcs.drp 16 \Program Files\Division\Product\SQL\Upgrade\2416\7.50.0\Company\
392 DexProcs.drp 16 \Program Files\Division\Product\SQL\Upgrade\2416\7.50.0\System\
393 Driver.ini 49 \Program Files\Division\Product\SQL\Lesson\2416\
394 Driver.ini 473 \Program Files\Division\Product\SQL\Upgrade\2416\7.50.0\
395 CAMAU.cnk 48154 \Program Files\Division\Product\
396 CAMCA.cnk 48154 \Program Files\Division\Product\

…and here’s the relevant section of my new MSI:

386 PreLoad.cmp 16 \Program Files\Division\Product\SQL\Install\1157\Company\Data\
387 Driver.ini 49 \Program Files\Division\Product\SQL\Lesson\2416\
388 Driver.ini 473 \Program Files\Division\Product\SQL\Upgrade\2416\7.50.0\
389 Indexes.cmp 7817 \Program Files\Division\Product\SQL\Install\2416\Company\
390 Tables.cmp 19842 \Program Files\Division\Product\SQL\Install\2416\Company\
391 DexProcs.drp 16 \Program Files\Division\Product\SQL\Upgrade\2416\7.50.0\Company\
392 Stubs.drp 16 \Program Files\Division\Product\SQL\Upgrade\2416\9.0.62\Company\
393 Stubs.drp 16 \Program Files\Division\Product\SQL\Upgrade\2416\9.0.62\System\
394 DexProcs.drp 16 \Program Files\Division\Product\SQL\Upgrade\2416\7.50.0\System\
395 Driver.ini 475 \Program Files\Division\Product\SQL\Upgrade\2416\9.0.62\
396 DexProcs.cmp 302470 \Program Files\Division\Product\SQL\Install\2416\Company\
397 CAMAU.cnk 48154 \Program Files\Division\Product\
398 CAMCA.cnk 48154 \Program Files\Division\Product\

OK, so the error is on the italic line above, and well, it’s the first file that doesn’t match its old ID. The bold files above were added, which appeared to cause this whole section to get spanked around.

Are there ways that I can get around this issue?

Answer 7

You need to build your upgrade package based off of the old such that you do not add files in the middle. You control how your package is built so you'll have to handle this yourself. Any new files in the upgrade package need to be added at the end of the file sequence.

Question 8

I would like to find out that is there a property that I can set inside my MSI so that we force the installer to cache a full msi instead of the msi in the installer cache?

Answer 8

Have a look at the ‘v’ option of the /f switch in the MSDN Topic Command Line Options.

Question 9

I get an error message that says: "Windows Installer Service can’t be contacted"

Answer 9

There’s this KB: "Windows Installer Service could not be accessed" error message when installing application”.

Question 10

Do you have troubleshooting pointers for the following error that occurs on x64?

Info 1721.There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: WiaRegSvr32.cmd, location: C:\Winparty2005\WiaRegSvr32.cmd, command: WiaRegSrv32.cmd

Answer 10

  • Have you verified that your code runs properly outside of an MSI installation?
  • Does the .cmd file work on x64?
  • Does your .cmd file run on x64 outside of the MSI package from the same location that it would normally be run (per the log file)?

Question 11

Is there an IA64 version of MSI 3.0 redist?

Answer 11

See https://support.microsoft.com/kb/898715/. MSI 3.1 ships with Win2K3 SP1 but you should update to v2 since v1 had a bug that could cause installations to fail during silent install scenarios.

Question 12

How do I extract files from an MSI package using native code?

Answer 12

Use MsiInstallProduct and include ACTION=ADMIN in szCommandLine...

Question 13

What are the top 10 ways to learn about ClickOnce?

Answer 13

Posted at https://blogs.msdn.com/saurabh/archive/2005/10/28/486106.aspx

Question 14

My Source MSI has 2 files both having File Version : 10
And My Target MSI has 2 files both having File Version : 11

I want to create an .msp for only for one file, not both the files. But when I create a .pcp file it is picking up both the files as the FileVerison has been changed. How can I do that?

Answer 14

Either don’t put the updated file in your Update MSI before building the patch or list the File foreign key for the file(s) you don’t want to update in the UpgradedFilesToIgnore table in the PCP file. See https://msdn.microsoft.com/library/en-us/msi/setup/upgradedfilestoignore_table_patchwiz_dll_.asp for more information.

Content credit also belongs to

  • Carolyn, MSI Team Dev Lead. You can get other Carolyn insights about developing for Windows Installer from the Windows Installer Chat Archives
  • Hem, MSI Team Dev. You can get other Hem insights about developing for Windows Installer from the Windows Installer Chat Archives
  • Heath, Microsoft Developer. You can get other Heath insights about developing for Windows Installer from Heath's blog
  • Prashant, Microsoft Developer

[Author: Robert Flaming]

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at https://www.microsoft.com/info/cpyright.htm.

Comments