cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Nick_Umanski
Level 7

Copy files from a Network location

My installer allows the placing of file in the same folder as the Setup.exe and upon running the installer, it copies this file into the INSTALLDIR using a VB Script CA.

The CA used to run after the execution sequence, but I had to modify this for Vista and Windows 7 recently, to make it a deferred action.

Everything works fine if the Setup.exe is on the local machine but try to run it from a network location and the file doesn't get copied. On XP I found that I had to change the CA from "Deferred Execution in system context" to simply "Deferred Execution". But on Vista and above neither work (unless it is run from the local machine).

Any ideas? Thanks in advance.

Basic MSI
Labels (1)
0 Kudos
(4) Replies
MSIYER
Level 8

INSTALLDIR might not be available in the Deferred Context CAs. You need to use CustomActionData to make it available in the deferred context. This has to do with the UAC implementation.

Also, network resources will not be available to any CA running under Deferred Execution in System Context.
0 Kudos
Nick_Umanski
Level 7

Yes this is part of the modification I had to do to make it a deferred action. ie Pass in all parameters through the CustomActionData and parse it out inside VBScript. This works fine, I even tried posting a message to the screen displaying the results, the parsed to and from fields and fine. Note it works if I run the install from the local machine.

I know that I can't access network drives when running in system context, this is a security feature of windows. Hence I changed the CA from 'Deferred Execution in System Context' to plain 'Deferred Execution' and it works now on XP, but not in Windows 7.

However, I don't really know what I'm doing in this area. I have a vague recollection that 'Deferred Execution in System Context' is a must for Vista and above. Is the only solution to tell my QA people that it isn't possible to do this over a network.
0 Kudos
MSIYER
Level 8

Why do you not just invoke an exe and do the copy?
You can use Win32 APIs... OR an opensource copy utility...

I remember having done that once in my bootstrapper exe.

This is just to confirm that the script is not the culprit...

Something to do with cscript engine or security for script execution etc...
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

The "ideal" fix for this is probably a two-part custom action. One in launching context which reads the file in (either to a system-local temp folder, or to a CustomActionData property), and one in system context which writes the file out. Unless a MoveFile table entry handles this better.
0 Kudos