Hi,
1. Set the whole package to be ran in administrator mode in "Install Parameters". This will run the installer only as the administrator or will it apply to my installed application as well?
This will set only the installer to run as administrator and every process that it starts during the installation. After the installation finished, that option will not affect your application or anything else.
2. If I create a simple MSI for the batch file and set it as a custom launch file action can the action run before the installation of my prerequisite V2? Where in the sequence do I put the action?
If you create a simple MSI it is recommended to put your BAT file as a custom action after the "Add Resources" action group in the sequence. Then you will add the simple MSI package as a prerequisite before the V2 prerequisite and it will uninstall the old version of your prerequisite before installing the new one.
3a. I can set it to search based on the product code and let the MSI run only when the product is found? But doesnt the install condition trigger when some or all of the conditions are false and not when all conditions are true? Please see screen capture below.
Indeed, the prerequisite is installed only when the conditions are false. That is why I suggested to set the "Always install prerequisite" option for it and create a "Product Version (identify by Product Code)" extended search in the simple MSI package and use it as a condition for the BAT file custom action.
3b. I can set the MSI to always be installed as a prerequisite and it will do no change if the batch does not find my prerequisite v1 and if it doesnt register with windows installer. However doesnt this mean that my installer wizard will have this prompt because the prerequisite is set to always run whether my prerequisite v1 is installed or not? Please see screen capture below.
Yes, the simple MSI will always be displayed on that dialog if the "UI level" is set to "Full UI" in the "Pre-install UI" section from the "Dialogs" page.
If you want it to be installed only when the old version is installed (V1), you can create a "Registry key does not exist" or "Registry value does not exist" that searches for a registry entry related only to version V1. So, the simple MSI will be installed only if that registry entry exists on the machine.
In this case, you don't need to set any condition for your BAT file custom action, because it will be executed only when the simple MSI prerequisite will be installed.
Best regards,
Eusebiu