App-V scripts fails with "Permission Denied" error
Hi All,
I'm trying to use a script that sits within the App-V package but after intially launching fine for me when someone else starts to use the application they get a permission denied error.
The scripts function is to do a date/time comparisson against a file that sits within the package versus a file that sits on a server. If the file on the server is newer than the file within the package then the script copies the file from the server and should then (theorhetically) overwrite the file within the package.
This is the body of the VBscript that is within the package:
Dim objFSO, strSourceFile, strDestinationFile, objSourceFile, objDestinationFile, dateSource, dateDestination
Set objFSO = CreateObject("Scripting.FileSystemObject")
strSourceFile = "\\ServerName\UAT\AppName\Version\EXE\APP.exe"
strDestinationFile = "Drive Letter:\12345678\AppName\APP.exe"
'strSourceFile = WScript.Arguments.Item(0)
'strDestinationFile = WScript.Arguments.Item(1)
If objFSO.FileExists(strSourceFile) Then
Set objSourceFile = objFSO.GetFile(strSourceFile)
dateSource = objSourceFile.DateLastModified
If objFSO.FileExists(strDestinationFile) Then
Set objDestinationFile = objFSO.GetFile(strDestinationFile)
dateDestination = objDestinationFile.DateLastModified
If dateSource <> dateDestination Then
objSourceFile.Copy strDestinationFile, True
If UCase(Right(strDestinationFile, 4)) = ".EXE" Then
MsgBox "APP has been updated to v" & objFSO.GetFileVersion(strDestinationFile), 64, "APP"
End If
End If
Else
objSourceFile.Copy strDestinationFile, True
If UCase(Right(strDestinationFile, 4)) = ".EXE" Then
MsgBox "APP has been updated to v" & objFSO.GetFileVersion(strDestinationFile), 64, "APP"
End If
End If
Else
MsgBox "File not found:" & vbCrLf & vbCrLf & strSourceFile, 48, "Error"
End If
And this is how the paramters of the script are set in the OSD file
<SCRIPT PROTECT="TRUE" WAIT="TRUE" TIMING="PRE" EVENT="LAUNCH">
<HREF>%SystemRoot%\System32\wscript.exe //E:VBS //NoLogo DriveLetter:\12345678\APP Name\APP_exe_copy.vbs</HREF>
</SCRIPT>
"DriveLetter" being the designated drive letter we user for the App-V client.
As mentioned we get Permission Denied error at what appears to be the following point of the script
"objSourceFile.Copy strDestinationFile, True" (Line 22, Char 4 accoring to the error prompt)
I have checked the permissions of the package and it appears to be OK and the locations of the file and it's destination are also correct.
I am at a loss as to why it can work for me initially and then not later on. Any suggestions would be gratefully appreciated.
App-V client is on a Citrix server running in Offline mode with "Allow disconnected operation" enabled.
Answers (2)
Nothing springs immediately to mind here, but here are a few things to look at...
- Are you enforcing security descriptors?
- Can the launching user access the server share?
- Is the file marked as User or Application data? It will copy in for each new user as the new file will sit in the userpkg file.
- Standard users may not be able to open your mount point drive (Q:\ by default), but you can as an admin. Try using the %SFT_MNT%\<path> variable instead - This might be your issue.
See here for further information about OSD Scripting: http://blogs.technet.com/b/appv/archive/2007/10/11/scripting-within-an-osd-file.aspx
Hope that helps,
Dunnpy