I am having an issue launching a batch file with a custom action. I have seen some other post but does not seem to resolve my issue.
This is a simple msi that drops some profile configuration files into the following location:
C:\Users\%UserName%\AppData\Roaming\OpenVPN Connect\profiles
So far, I have done the following:
In Install Parameters I have defined the property
"User_VPN_Profile" with a value of "C:\Users\%UserName%\AppData\Roaming\OpenVPN Connect\profiles"
In Instillation Folders > Application Folder, this points to [User_VPN_Profile]
In Files and Folders I created a new property based folder > User Defined > and pointed this to [User_VPN_Profile]
Dropped all the files i require to go to this location info that folder.
Test the install and it installs (Copies) the files to the correct location. ("C:\Users\%UserName%\AppData\Roaming\OpenVPN Connect\profiles")
I then created a "Custom Action > Launch File" and put this at the end of the "Install Execution Stage"
The batch file to run is location with the other files in the user roaming profile called "InstallProfile.bat"
The batch file contains the following:
Code: Select all
@ECHO OFF
"C:\Program Files\OpenVPN Connect\OpenVPNConnect.exe" --import-profile="C:\Users\%UserName%\AppData\Roaming\OpenVPN Connect\profiles\VPN AEC.ovpn" --username=ENTER_USERNAME
File to lauch > [#InstallProfile.bat]
Working Directory > "[User_VPN_Profile]" (Tried with "" and without)
Execution time > immediately (also tried deferred)
I cant quite fathom what I am doing wrong. if i set it to run as administrator in the custom action, the install does not fail however, the batch file needs to run under user context as the profile need to be installed from >%Username% of the user.
Any help would be greatly appreciated.