Solved

How do you condition two components containing same file name on registry search?

Posted on 2010-08-12
11
1,083 Views
Last Modified: 2013-11-14
Hi,

I have an interesting problem right now and I have been trying to come up with a Windows Installer solution.  My requirement is straight forward enough:  There exist two versions of the same file, one in english and another for other languages, both have same file name. My task is to have the installer determine the correct file and install.  Anyhow, I created two unique components in my MSI package (unique GUID).  Each component is conditional on a registry (system search) and stored in a property for use.  

The build is working ok, but during install, the two components are not reliable whatsoever - even though the registry setting appears to be captured...The installer is not installing correct file based on condition, it installs at best, random.  What does this all mean? The conditions I placed are REGISTRY = XX and REGISTRY <> XX.  I have even tried specifying the registry value in the system search and use REGISTRY and NOT REGISTRY conditions.  Nothing seems to work!

I ran the ICE validator and it returned back ICE30, an error to do with two distinct file names, etc. Anyhow, I have checked the tables directly for any missing signatures or inconsistent signatures, I find nothing.  

I'm not sure what else to do then scrap this MSI project and write VBScript to carry out my installation, I really do not want this. I would ideally like an MSI package.  Any ideas what might be going on here?

Any help is much appreciated.
0
Comment
Question by:SugaBaby
  • 6
  • 5
11 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 33425592
I think, the right way to address this problem is by so called Qualified Components - details are at http://msdn.microsoft.com/en-us/library/aa370947%28VS.85%29.aspx

If you don't want to go that way, then I would troubleshoot by showing the result of your condition on a dialog, or by showing a message, or by debugging.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 33425595
clarification: "this problem" in the prev. comment means installing different versions of the same file depending on the language.
0
 

Author Comment

by:SugaBaby
ID: 33449600
I have now added the components to the PublishComponents table.  I am still having same issue - even using this so called "qualified" component idea, still produces no improvement.  Now, I am looking at the log file line by line.  I see an entry that I cannot explain:

Action start 16:27:21: INSTALL.
Action start 16:27:21: AppSearch.
MSI (s) (B8:38) [16:27:21:430]: Note: 1: 2262 2: Signature 3: -2147287038
MSI (s) (B8:38) [16:27:21:430]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\SOFTWARE\Test\Country 3: 2
MSI (s) (B8:38) [16:27:21:430]: Doing action: LaunchConditions

From this, I see that the installer is not executing the system search I created to check the registry key value, store within a property and finally install the correct file based on the property value.  Or it is performing the system search, but the registry key has no permissions? Error 2262 and 1402 make no sense to me; I am not sure what to do here.  
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 33449677
2262 means "stream does not exist", and 1402 means "could not open key because of system error" . I would (1) very closely look at the system search, if it's really looking for registry value (rather than for directory, for example), and (2) practiced this system search on new trivial sample installation created from scratch.
0
 

Author Comment

by:SugaBaby
ID: 33449777
This is a very strange error for a system search. System search should be easily executed - I have never seen a registry key being unreadable for a system search.  I am using InstallShield.  I may try Wise or VIsual Studio to create a new install project and see how it goes.  

The other factor involved here is the two conditional files are both havng the same name and directory location - i.e. I want my installer to detect, by registry key, which file should be installed. I notice the components involved give a unique key for each, so I don't know if this matters.  
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 33454011
Things like this sometimes happen when you erroneously use not "search for registry key" but "read directory name from registry". Does the table RegLocator have 2 in Type column?
0
 

Author Comment

by:SugaBaby
ID: 33455373
Hi,

Yes the Type column has 2 in the entry.  Below I have pasted in the value types:

msidbLocatorTypeDirectory 0x000 0 Key path is a directory.
msidbLocatorTypeFileName 0x001 1 Key path is a file name.
msidbLocatorTypeRawValue 0x002 2 Key path is a registry value.
msidbLocatorType64bit 0x010 16 Set this bit to have the installer search the 64-bit portion of the registry. Do not set this bit to have the installer search the 32-bit portion of the registry.

2 seems to be the proper value.  Not sure what to think here.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 33455931
thoughts:

1. is this the only search in the installation?

2. Try #2 from http:#33449677 . Also I would use regmon /process monitor to see what Installer is actually searching for.

3. upload your installation here (change file extension to .txt) and I'll take a look.

0
 

Author Comment

by:SugaBaby
ID: 33456254
This is the event capture from process monitor.  It seems like key is opened for read, but returns not found result.  I have no idea how this could be the case because the key exists prior to running installation, this seems very unusual.  

Date & Time:      8/17/2010 12:01:50 PM
Event Class:      Registry
Operation:      RegOpenKey
Result:      NAME NOT FOUND
Path:      HKLM\SOFTWARE\Test\Country
TID:      3200
Duration:      0.0000120
Desired Access:      Read
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
ID: 33456280
Verify that the key name does not have a space in the end, and that Country is indeed the key rather than value under HKLM\SOFTWARE\Test\
0
 

Author Closing Comment

by:SugaBaby
ID: 35353409
In InstallShield, you must always specify one branch up when doing a system search for a key, then it works perfectly.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Among others, I monitor the Windows Installer zone and Installer zone. I find that many of the questions could be answered much more quickly if a Windows Installer verbose log were submitted with the question.   However, I do not always have t…
I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now