Windows Installer conditions
I'm having a small issue here.
I've set up two conditional components. The command line will determine which .ini file is installed to C:\winnt\myinifile. So I've setup two folders in my wisesourcepath:
.\windows\1\myinifile.ini
.\windows\2\myiniflile.ini
When I install the software with a commandline of, "inifile1", it's failing because it can't find ".\windows\inifile.ini (this wont exist because I'm not pulling the file from "windows\inifile.ini".
If the commandline contains inifile1 then it should pull the ini file from .\windows\1\myinifile and install to C:\winnt\myinifile.ini
If the commandline contains inifile2 then it should pull the ini file from .\windows\2\myinifile and install to c:\winnt\myinifile.ini.
I've done this before but it's not working now.
Component 1 is "myinifile1" with a condition of, "inifile="inifile1""
Component 2 is "myinifile2" with a condition of, "inifile="inifile2""
I'm going nuts. The contents of the 2 inifiles are different and need to be installed pending the commandline.
Answers (4)
Essentially what you are trying to do is setup 2 files with the same name, installed fromdifferent Source directories. Most commonly used for drivers where you see x86 and x64 folders...
Most of this has to do with the directory table entries... Here is a site that greatly helped when I had to do something similar.
That being said... there could be an easier way. Since the files are INI, you can create your conditioned ini edits using that method instead. No issues with file sources, cause there isn't any.
Another way to do something similar would be to install both INI files to your INSTALLDIR, in different folders obviously... Then use conditioned components and the duplicatefiles table to copy one or the other to the proper location.
Create the following two PUBLIC Properties in properties table
INIFILE1=0
INIFILE2=0
Keep your myinifile.ini (from .\windows\1\myinifile) in inifile1 component, keep INIFILE1=1 as component condition
and then
Keep your myinifile.ini (from .\windows\2\myinifile) in inifile2 component, keep INIFILE2=1 as component condition
now, if you pass INIFILE1=1 in command line then myinifile.ini from (from .\windows\1\myinifile) will be installed
if you pass INIFILE2=1 in command line then myinifile.ini from (from .\windows\2\myinifile) will be installed
If you dont pass any of these property then both will not be installed as they have 0 in property value..
Comments:
-
Have tried this method with public properties as I mentioned in the above post - jagadeish 12 years ago