VMware Horizon Community
btrabue
Enthusiast
Enthusiast
Jump to solution

Script to create folder on physical drive and not in package

Hello -

Attached is a script that I have that will create a folder on the C:\ inside of the bubble.  What I need is for it to create a folder on the physical drive and not inside of the bubble.  Can anyone tell me what I have done wrong here?  I have a similar script that creates a folder on the D drive for linked clones and it works fine.  Thanks in advance!!

0 Kudos
1 Solution

Accepted Solutions
Lakshman
Champion
Champion
Jump to solution

Change the isolation mode of %drive_C%\vaforms5 folder to 'Merged' in the Attributes.ini, rebuild the ThinApp and check.

Using Merged Isolation, the application can read/write file to the physical machine.

View solution in original post

0 Kudos
17 Replies
Lakshman
Champion
Champion
Jump to solution

Are you trying to copy copy vvwt5.mdb file from the ThinApp package to your physical C:\vaforms5\vvwt5.mdb?

0 Kudos
Sukrut
Enthusiast
Enthusiast
Jump to solution

Hi,
You need to set DirectoryIsolationMode=Merged for %drive_C%.  Default isolation mode will be WriteCopy or full. If %drive_C% is not present in capture folder then create it and create ##Attributes.ini inside it and write DirectoryIsolationMode=Merged in the file.


Please note that it’s not recommended to set isolation mode of c:\ to Merged. I will suggest create a folder inside c: drive say c:\Test, and set DirectoryIsolationMode=Merged for this folder and modify your script accordingly.

If you find this information useful, please mark for 'helpful' or 'correct' answer to reward points.
0 Kudos
Sukrut
Enthusiast
Enthusiast
Jump to solution

Rebuild the package and delete old sandbox before execution.

If you find this information useful, please mark for 'helpful' or 'correct' answer to reward points.
0 Kudos
btrabue
Enthusiast
Enthusiast
Jump to solution

That got me a little further.  I change the isolation mode from full to merged for the folder that is on the C drive instead of the C drive itself.  When the thinapp opened I went to the C drive and noticed the folder there.  I then looked inside it and the only file that was in there was the locked file for the database.  The database itself was not in there.  For the locked file to be in there tells me that the database itself is still in the dat file and not showing up like I need it to on the C drive.  Any ideas?  Thank you for your help!

0 Kudos
btrabue
Enthusiast
Enthusiast
Jump to solution

Lakshman -

Yes.  I am just needing the file to show up inside of that folder.  The users need to have it to FTP back to the office when they modify it daily.

0 Kudos
Sukrut
Enthusiast
Enthusiast
Jump to solution

What is the source location of the file? is it same as destination location? means C:\vaforms5\vvwt5.mdb?

If you find this information useful, please mark for 'helpful' or 'correct' answer to reward points.
0 Kudos
btrabue
Enthusiast
Enthusiast
Jump to solution

Yes.  If I can get it to show up on the C drive for the user then I won't even need the script.  

0 Kudos
Sukrut
Enthusiast
Enthusiast
Jump to solution

If the file is already in package then only a write operation on the file can put that file in sandbox or system. But I think you can copy that file with some other name in the folder and then try to rename it to original one.

Let me know the results.

If you find this information useful, please mark for 'helpful' or 'correct' answer to reward points.
0 Kudos
Lakshman
Champion
Champion
Jump to solution

Please find attached the vb script (rename to .vbs) that copies vvet5.mdb file from %appdata% in the ThinApp project folder (not Sandbox) to C:\ of the physical machine.

0 Kudos
btrabue
Enthusiast
Enthusiast
Jump to solution

Lakshman -

I just found out that the application has built into it to look for the database in C:\vaforms5.  The user will need to be able to see this folder on the C drive so that they can FTP the database.  I can see the folder on the C drive but the only file that is in there is the lock from the database.  The thinapp is opening the file as it should but it is not displaying it on the users C drive.  Sorry if this is confusing, because it sure is to me.  Thanks!!

0 Kudos
Sukrut
Enthusiast
Enthusiast
Jump to solution

If the file is in package and at same location e.g. C:\vaforms5\vvwt5.mdb, then ThinApp will copy it to sandbox always e.g. %sandbox%\%drive_C%\VAForms5\ vvwt5.mdb. It will not be present on physical location means on C:\vaforms5\vvwt5.mdb.

I will suggest 2 workarounds.

  1. Share sandbox path with other users so that they can access file from that location. (FTP)
  2. Rename file in package to other name e.g. %\%drive_C%\VAForms5\ vvwt5_1.mdb, and then copy it using same script to C:\vaforms5 with original name i.e. vvwt5.mdb.
If you find this information useful, please mark for 'helpful' or 'correct' answer to reward points.
0 Kudos
Lakshman
Champion
Champion
Jump to solution

Change the isolation mode of %drive_C%\vaforms5 folder to 'Merged' in the Attributes.ini, rebuild the ThinApp and check.

Using Merged Isolation, the application can read/write file to the physical machine.

0 Kudos
btrabue
Enthusiast
Enthusiast
Jump to solution

Ok, here is what I have...

I have the vvet5.mdb file in the VAForms folder in the package.  I set the directoryisolationmode to merged for both the %drive_c% and the VAForms folder just under the C drive.  I then rebuilt the thinapp and ran the exe.  I can go to the C drive and I can see the VAForms folder that the thinapp creates but when I open the folder all that I can see is the vvet5.ldb file that is created when the database is opened.  On the build under the VAForms5 folder there is the vvet5.mdb file along with several folders.  I understand tha the folders should not be seen, but I would think that the database file should be appearing under the VAForms5 folder on the C drive.  Any other ideas or am I doing something wrong?  I just don't see how.  Thank you!!!!

0 Kudos
Lakshman
Champion
Champion
Jump to solution

>>  I can go to the C drive and I can see the VAForms folder that the thinapp creates but when I open the folder all that I can see is the vvet5.ldb file that is created when the database is opened

From which location are you opening the database file vvet5.mdb?

0 Kudos
Sukrut
Enthusiast
Enthusiast
Jump to solution

You are not doing anything wrong here!

But ThinApp ‘Merged’ Isolation mode works differently than what you expect.

If the file is in package and directory isolation mode is ‘merged’ then ThinApp always creates that file in Sandbox. It will not create that file at actual path i.e. in your case c:\VAForms that’s why you will not see the file in c:\.

But if application creates any new file (which is not present in package) in this folder then that file will be created at actual path .i.e. c:\VAForms. That’s why you find vvet5.ldb in c:\VAForms.

You need to consider the workarounds given in update 11.

If you find this information useful, please mark for 'helpful' or 'correct' answer to reward points.
Lakshman
Champion
Champion
Jump to solution

Thats right. As i said before, Merged isolation can read/write files to the physical machine.

Please find attached another VB script that copies the vvet5.mdb file from the virtual environment to the physical C:\VAForms\vvet.mdb

Note that the file name is changed from vvet5.mdb to vvet.mdb

btrabue
Enthusiast
Enthusiast
Jump to solution

I know what I was doing wrong.  I had not put the script back into the build.  After setting the Directory isolation mode to merged for the C drive and the VAFolder5 folder it worked perfectly.  Once again that you Lakshman!  

0 Kudos