Solved

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

Posted on 2010-08-12
11
1,119 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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 …
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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