How to use launcher's PostDeploy.bat

A new feature has been added as of MCSLauncher v2.1 that allow a post-deploy batch file to be executed everytime an upgrade is deployed locally.  This is useful when you need to perform some modification to the deployment everytime it changes.  For example, there are occasionally needs to force an application to always run in 32-bit mode on a particular workstation (such as when the scanner only works in 32-bit applications).  

After deploying the upgrade and copy the LocalDeploy folder contents, if any, MCSLauncher will check if a PostDeploy.bat file exists (in the same folder as the Run<Programname>.exe folder).  The batch file will be executed with the working directory set to the same folder.  It will have 3 special environment variables set:


variable namedescription
MCS_LocalAppDataPaththe folder, including trailing backslash, containing the target of the deploy (e.g. c:\users\Tim\AppData\Local\MCS\Franklin\ )
MCS_CommonAppDataPaththe folder, including trailing backslash, containing the program's common data folder (e.g. c:\programdata\MCS\Franklin\ )
MCS_PrimaryExecutableNamethe name of the primary assembly (e.g. Franklin.exe)


To setup forcing Franklin to run 32-bit, you would do the following:

1.) Using admin console, make sure MCSLauncher is upgraded to 2.1 or later

2.) Place CorFlags.exe in the c:\program files\MCS\Franklin folder

3.) Create a file called c:\Program Files\MCS\Franklin\postdeploy.bat with the following contents

corflags "%MCS_localappdatapath%Franklin.exe" /32BIT+

Once postdeploy.bat is run succesfully, you should be able to open task manager and see that Franklin.exe is running in 32 Bit mode. It will have "*32" (This will only show up on a 64 Bit OS as this denotes that a program is running in WoW mode).

As this only runs on deploy, if you have already upgraded and want to force a new deploy then delete the version.xml file in the MCS_LocalAppDataPath.

This file is likely located in the user's appdata MCS folder. If not, please review the comments below.