Installing a Component based on a condition
before I start I want to make clear that I tried my best to find solutions to this problem before I decided to post here. I found various posts on this topic but none of them worked (at least not like I thought they should).
So here is my problem: I have a software which has a folder in which it saves a custom dictionary for spell checking. Since the software in question has to be deployed on a terminal server I have changed the path in a mst file (in order to avoid that the users of the terminal server overwrite each others custom dictionary). I created a new component which soley exists for creating this path on a network drive and everything works fine on a normal client.
Thing is, on the terminal server at the moment of the installation the service account of DSM7 doesn't have this network drive so the installation would fail. In order to fix that, each msi gets installed a second time with /fup parameters (in order to fix the registry and so on). I tried to use conditions in the component table in order to prevent the creation of the folder in the first "normal" installation but still creating it in the repair install. Sadly enough, none of the parameters/conditons I tried worked (like MaintenanceMode="Repair" or Installed and so on). All I archived is that it doesn't create the folder in the first (normal) installation but ist also doesn't install it in the repair run.
Obviously I'm missing something and of course I could easily get rid of this problem by a simple makedir command in DSM7 but I want to understand and learn why I can't seem to add it to the mst file. Like I said at the start of my post I tried to find a post on the matter, I read the documentation on the tables in question but I couldn't find a solution. Oh and I only use DSM7 for the deployment but not for editing the .mst. For that purpose I use InstEd.
If you need any kind of additonal information, please tell me. It's my first time posting here so I might have forgotten something.
Thank you for reading, it would be great if you could point me in the right direction :)
When you are checking the value of MaintenanceMode, you should not use MaintenanceMode="Repair" as condition, instead you should use _IsMaintenance="Repair" as condition anywhere after the MaintenanceType dialog box.
Moreover, _IsMaintenance is a private property—its name contains lowercase letters—its value will be reset when execution switches from the User Interface sequence to the Execute sequence, and therefore it cannot be used in the Execute sequence to detect the installation type.
funny how things start to work if you continue a day later... I just found an article about the matter and I was 100% sure I used the REINSTALL Condition already but apparently I was wrong: now it works, I just entered REINSTALL AND NOT PATCH AND NOT REMOVE=~"ALL" and it seems to do the job. Since I only create a path with this condition I don't think I need to be aware of the fact that REINSTALL is set while patching/uninstalling, but I thought it might be a good idea to add the other two condition parts. If you guys think that is wrong/not needed please tell me. As someone who tries to understand MSI on his own its sometimes kinda hard to differ between right and wrong ;)