Copy Java APM ZIP File

Microsoft.JEE.Apm.Copy.Zip.WriteActionModuleType (WriteActionModuleType)

Extract the Java APM JARs and modules and place them in the 'temp' folder.

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
InputTypeSystem.BaseData
OutputTypeSystem.BaseData

Member Modules:

ID Module Type TypeId RunAs 
CopyFiles WriteAction Microsoft.Windows.ScriptWriteAction Default

Source Code:

<WriteActionModuleType ID="Microsoft.JEE.Apm.Copy.Zip.WriteActionModuleType" Accessibility="Public" Batching="false">
<Configuration/>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="CopyFiles" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
<ScriptName>JEEApmCopyUserFiles.vbs</ScriptName>
<Arguments>"$FileResource[Name='Microsoft.JEE.Apm.Zip']/Path$"</Arguments>
<ScriptBody><Script>
''' Copyright (c) Microsoft Corporation. All rights reserved.
''' Date Created: Apr 23th, 2013
'
Option Explicit
SetLocale("en-us")

'
' Get the FQDN on the machine
'
FUNCTION GetFQDN(WshShell)
DIM TCPParams, hostname, domain
TCPParams = "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\"
hostname = WSHShell.RegRead (TCPParams &amp; "Hostname")
domain = WSHShell.RegRead (TCPParams &amp; "Domain")
IF domain = "" THEN
GetFQDN = hostname
ELSE
GetFQDN = hostname &amp; "." &amp; domain
END IF
END FUNCTION

'
' Copy a single file, if it exists, to specified folder
'
FUNCTION CopyAFile(myWScript, userSuppliedFSO, targetDir, fileName, fqdn)
IF userSuppliedFSO.FileExists(fileName) THEN
userSuppliedFSO.CopyFile fileName, targetDir
myWScript.Echo "Copied " &amp; fileName &amp; " to " &amp; targetDir &amp; " on " &amp; fqdn
END IF
END FUNCTION

'
' Copy the specified file to the system temp folder
'
FUNCTION CopyUserFiles(file1)
DIM myWScript, myFSO, WshShell, WshSystemEnv, targetDir, fqdn
SET myWScript = WScript
SET myFSO = CreateObject("Scripting.FileSystemObject")
SET WshShell = CreateObject("WScript.Shell")
SET WshSystemEnv = WshShell.Environment("System")
targetDir = WshShell.ExpandEnvironmentStrings(WshSystemEnv("TEMP")) &amp; "\"
fqdn = GetFQDN(WshShell)
CopyAFile myWScript, myFSO, targetDir, file1, fqdn
END FUNCTION

DIM oArgs
Set oArgs = WScript.Arguments
if oArgs.Count &lt; 1 Then
Wscript.Quit -1
End If

CopyUserFiles oArgs(0)
</Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="CopyFiles"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.BaseData</OutputType>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>