I have been tasked with installing a prerequisite where the run behavior can change depending upon the machine state.
1. If it is the first run, it must ask the user for the installation path.
2. If it has been installed, it should use the path defined in a previous installation
3. Optionally (and preferred), it should accept command line parameters from the bootstrapper.
What I have done is create 2 prerequisites for the same package. the only difference between them is the existence of a registry key that would have been installed as permanent.
if the key is found, it runs in passive mode and may preform the "upgrade" (automatic uninstall/install) else it installs without the passive switch.
I have not discovered a way to pass the command line parameters to the prerequisites and think that it is probably not available. I thought I would ask though since the answer will either confirm my suspicion or simplify my work.
I have also considered using a script as a prerequisite and having it call the prerequisite, but don't really like that idea very much as it does things outside the the current windows installer package. Further, I think that may produce the dreaded, "you are already running windows installer" message.
Any thoughts?
Thanks,
George