0

Problem:
I have a User Requirement in which a file would not be installed if a Prerequisite application is absent on users machine. But after installing my product, when user would install that Prerequisite application, he would run my installer and choose repair to install that missing file and its related registry entries.

My expectations:
I know Repair would only repair those files that would already been installed by first installation. But isn't there any workaround about this???

Any here and there with AddLocal???

Erik
  • 503
  • 1
  • 7
  • 26
Farrukh Waheed
  • 2,163
  • 2
  • 29
  • 59

3 Answers3

1

You can use a condition inside a component tag. Example:

<Component Id="RepairOrReinstallOnly" Guid="YourGUID" Transitive="yes">
    <Condition>
        INSTALLED AND (NOT UPGRADINGPRODUCTCODE)
    </Condition>
    ...
</Component>

This way the component should be only installed on repairs, modifcations and reinstalls.

But it will not be installed on the first install (INSTALLED is false) or if you do a major upgrade (UPGRADINGPRODUCTCODE is true).

Chris
  • 3,113
  • 26
  • 33
0

So you have an application containing 2 programs. When we run the installer, it only installs program 1 and doesn't install program 2 because the prerequisite program is not installed.

Now when you install the prerequisite program and want that program 2 which was not installed, it should be installed when your installer is run again.

On an installer, there are 3 options. Add/Remove feature, repair, and uninstall. You can go to Add/Remove feature and select program 2 and install it.

You need to make conditions on installer that if pre-req is not installed, program 2 cannot be installed. So when you try to install for the first time and you select program 2 or full install, it will tell you that you cannot install this since the pre-req is not there. It will only install program 1. And on running setup again, it will show Add/Remove feature option.

Erik
  • 503
  • 1
  • 7
  • 26
fhnaseer
  • 7,159
  • 16
  • 60
  • 112
0

I don't think this is feasible because when Windows Installer caches your .msi, the .cab files are removed. That means the source files which were originally skipped would not be available unless the user has kept the original installer around. It's a bit of a stretch to make that assumption.

My suggestion would be to either always install the file, or try to have your application manage the deployment of the optional file(s). I've found that any time you try to do non-standard things in the installer, it becomes far more complex to manage, and much more difficult to prevent subtle problems from creeping in.

Dave Andersen
  • 5,337
  • 3
  • 30
  • 29