I do have a solution for you, but I really want to discourage you from using it. :)
Solution:
Architectural considerations:
Your all problems (in fact everything described in this thread) are caused by the fact that you are trying to push your setup to do something that it's not design to do - Configuration.
Do you remember the fundamental design principle "Separation of concerns"? Apply it to your problem. Setup (any setup) is concerned about deploying of the files. Full stop. Configuration is not part of the setup but a part of the application initialization stage. That is why MS introduced a great deployment guideline (as part of the Vista application certification). This guideline requires the applications to configure the user profile on the first start of the installed application but not at the installation. The benefits are enormous:
If you agree with this concept than you can completely remove your ntrights.exe form the setup and embed it as a resource in your app. And on the first start extract ntrights.exe in the temp folder, run...... you know the drill.
Good luck.
Solution:
- Add your ntrights.exe to your project as Binary not as File
- Have your managed custom action executed during both install and repair. You can have it at any step. Even Before InstallInitialize.
-
In the managed CA extract ntrights.exe from MSI int a temp dir, run and delete it.
Architectural considerations:
Your all problems (in fact everything described in this thread) are caused by the fact that you are trying to push your setup to do something that it's not design to do - Configuration.
Do you remember the fundamental design principle "Separation of concerns"? Apply it to your problem. Setup (any setup) is concerned about deploying of the files. Full stop. Configuration is not part of the setup but a part of the application initialization stage. That is why MS introduced a great deployment guideline (as part of the Vista application certification). This guideline requires the applications to configure the user profile on the first start of the installed application but not at the installation. The benefits are enormous:
- No need to have a complicated setup UI as no need to interact with the user after the last file is deployed. The user interaction is delegated to the application executable. You can still start the app (in config mode) at the last step of the installation.
- Simple path for reconfiguration of the application. Start it at any time in the config mode without resorting to the "Repair", which effectively installs the product again for no real reason.
- App upgrade is incredibly simple. Upgrade binaries and the app itself will pick the prev app settings if present.
- Licencing, target system validation all becomes very straight forward.
-
...
If you agree with this concept than you can completely remove your ntrights.exe form the setup and embed it as a resource in your app. And on the first start extract ntrights.exe in the temp folder, run...... you know the drill.
Good luck.