Cameyo

Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: VB Scripting Error


Member

Status: Offline
Posts: 8
Date:
VB Scripting Error
Permalink   
 


Until recently this VBS worked great in getting these custom files from the source dir into the virtual app directory.

I've come across some systems that give me an error.

Is it unable to find the source files or the Vapp directory?, is it possible the Vapp dir would be changed to a different drive letter?

Attached is a screen shot of the error and script code.

 

Please help.



Attachments
__________________

GTFOH



Guru

Status: Offline
Posts: 912
Date:
Permalink   
 

Have you tried editing your script to

FSO.CopyFile "tips.ini", "C:\GTFOH\tips.ini"



__________________


Member

Status: Offline
Posts: 8
Date:
Permalink   
 

Same result, works in the lab systems, when deployed to the end client systems I get the error.

__________________

GTFOH



Guru

Status: Offline
Posts: 912
Date:
Permalink   
 

Does your package contain C:\GTFOH directory?



__________________


Member

Status: Offline
Posts: 8
Date:
Permalink   
 

Yes, See attached



Attachments
__________________

GTFOH



Guru

Status: Offline
Posts: 912
Date:
Permalink   
 

First, I assume that when you edited your script from 

FSO.CopyFile "tips.ini", "C:\GTFOH\" 

to 

FSO.CopyFile "tips.ini", "C:\GTFOH\tips.ini"

you did the same for FSO.CopyFile "mytips.jpg", "C:\GTFOH\mytips.jpg"

yes?

 

If so, let's try without virtualization.  Copy %AppData%\Roaming\VOS\tips\PROG\%Scripts%\OnStartVirtualized.wait.vbs to the directory containing your Cameyo package and the unique tips.ini.  I think that's your shared folder.  Not the package's repository.

Edit the VBS to 

appdata = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%AppData%")
CreateObject("Scripting.FileSystemObject").CopyFile "tips.ini", appdata + "\VOS\tips\CHANGES\C_\GTFOH\tips.ini"
CreateObject("Scripting.FileSystemObject").CopyFile "mytips.jpg", appdata + "\VOS\tips\CHANGES\C_\GTFOH\mytips.jpg"

Run the edited VBS.  Any error, or did it copy your files to the package's sandbox?



__________________


Member

Status: Offline
Posts: 8
Date:
Permalink   
 

Yes, Both lines were updated as suggested.

Tried the updated copy command and got the same result, see attached.



Attachments
__________________

GTFOH



Member

Status: Offline
Posts: 8
Date:
Permalink   
 

I've been pouring over the settings and trying different approaches to the build.

This app is used in a multi-client/server model.

The Vapp and the two copied support files reside in a shared folder on the server and executed from that location.

Being that the application could be ran from multiple clients at the same time it would be best to keep the VOS and extracted support files on the client side.

I've confirmed read/write and NTFS access to the share data.

Is the issue a recognition of source dir?



__________________

GTFOH



Guru

Status: Offline
Posts: 912
Date:
Permalink   
 

It looks as if you didn't copy the script to the shared folder that contains the two files, tips.ini and mytips.jpg.  We are doing this strictly for troubleshooting purposes.  Please run the script unvirtualized from the shared folder.



__________________


Member

Status: Offline
Posts: 8
Date:
Permalink   
 

Ok, I tested from the source directory and the files copy over as expected with no error.

I updated the script in the package to your code, works in the lab, does not work at the site.

Tried to run the package as administrator, same result.

Tried adding the files directly to the package, the tips.exe application could not find the DB path in the ini.

It's as if the package is being isolated by the OS, no in or out data?

__________________

GTFOH



Guru

Status: Offline
Posts: 912
Date:
Permalink   
 

1. If you are able to distribute your package with the correct INI and JPG, then there is no need to use the script to copy them, so you should make them part of the package and delete %Scripts%.  

2. If the INI and JPG are prone to change and it is impractical to make them part of the package, you should delete them from the package.

3. If you can write to the user's real filesystem, your original script should work, but it must be changed to run unvirtualized instead of virtualized.  You may need to add a line to check if C:\GTFOH exists, e.g. If Not FSO.FolderExists("C:\GTFOH\") Then FSO.CreateFolder("C:\GTFOH").

4. Use Cameyo.exe -AddScript copy.vbs OnStartUnvirtualized wait tips.cameyo.exe to run the script unvirtualized.  Be sure to delete OnStartVirtualized.wait.vbs from %Scripts% so that you have only one script copying your files.  You can add an OnStopUnvirtualized script to delete the files from the user's computer once the program is quit if necessary.

5. If you do not want to write to the user's real filesystem, please provide a link so I can download your package and try to figure out why the original script is not working for the end user.  You can send the link by PM if you prefer.



__________________
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.



Create your own FREE Forum
Report Abuse
Powered by ActiveBoard