Change the MSI install path

June 16, 2016 — Leave a comment

Our security admins stopped allowing programs to launch outside of the Program Files folder so I was forced to find a solution.

Here’s what I came up with. I hope you find it useful.

@echo off
REM Copy Batch to Computer Needing Software
REM Run Batch as Administrator

REM Copy files, don't display names and overwrite if file already exist at destination
XCOPY "\\server_name\share_folder\software_folder" C:\ /q /y

REM Install Path for 64-BIT OS without display
IF %processor_architecture% == AMD64 (
start /wait msiexec /i "C:\file_name" TARGETDIR="C:\Program Files (x86)" /qn
start /wait msiexec /i "C:\file_name" TARGETDIR="C:\Program Files (x86)" /qn
)

REM Install Path for 32-BIT OS without display
IF %processor_architecture% == x86 (
start /wait msiexec /i "C:\file_name" TARGETDIR="C:\Program Files" /qn
start /wait msiexec /i "C:\file_name" TARGETDIR="C:\Program Files" /qn
)

No Comments

Be the first to start the conversation!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s