I work as a student for a company that sells a proprietary software solution. My task is testing their appliation in APP-V. The client should have the availability to modify a parameter, and this should be changed in the VFS after the package is installed.
Currently, I added following script to the scripts/ section of my V-APP package; This should modify something in LocalSetting.xml in ProgramData\OSG\ShellPlus\Config\
msgbox "test"
replaceWith = WScript.Arguments(0)
Set objShell = CreateObject( "WScript.Shell" )
appDataLocation=objShell.ExpandEnvironmentStrings("%PROGRAMDATA%")
localSettings = appDataLocation & "\OSG\ShellPlus\Config\" & "LocalSetting.xml"
Const ForReading = 1
Const ForWriting = 2
msgbox "test"
x = msgbox(localSettings, 0, "localSettings")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(localSettings, ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "OSG-021\SHELLPLUS", replaceWith)
Set objFile = objFSO.OpenTextFile(localSettings, ForWriting)
objFile.Write strNewText
objFile.Close
I added this to _DeploymentConfig;
<UserScripts>
<StartProcess RunInVirtualEnvironment="true">
<Path>.\Scripts\writeConfig.vbs</Path>
<Arguments>TEST</Arguments>
<Wait RollbackOnError="true"/>
<ApplicationId>[{AppVPackageRoot}]\..\Scripts\writeConfig.vbs</ApplicationId>
</StartProcess>
Now I tried running the .msi directly, but the script is never executed. Any ideas? I'm out of ideas..