Posted: 6 Oct 2016 6:11 EDT Last activity: 26 Aug 2020 8:17 EDT
Additional Files in Deployment
Can anyone please help with how to get an additional file included in a deployment package to expand to the location it came from i.e. c:\program files\this is the folder\i came from\*.exe rather than being in the same folder as the rest of the automation files.
Can't find anything online about what these directory options do:
***Updated by Moderator: Marissa. Removed user added #helpme and Ask the Expert group tags. Apologies for confusion, shouldn't have been an end-user option***
Why do you need the file at that location? Deployment will not do that but you can code to move it if you really need to. Deployment always expands to a set location based on the project ID of the project.
The application that we are running is an IBM client .bch session which some of our PC's have on in a standard location C:\Program Files\IBM\Client Access\Emulator\Private\ but some are missing the file. We planned to include the session file in the deployment and then we know for sure that it is there every time.
What do the various Path options do under Folder as per the image in my original question? I can not find anything online that explains this option and the explanation text just says 'File folder expanded at runtime' - does this mean that the file will be placed in this folder and run from here after deployment, i.e. if I set to desktop the file will be expanded to the users desktop and the original path overridden to run from here?
Again, the best way to do this is to move the file from the deployment package extract location to the location you want. Remember, that the user will need permission to copy the file to that location. You can find out where the project is deployed by adding the GetProjectPath method to the Toolbox. Here is how to do that.
You can use GetProjectPath to get the full path to the project. This will include the .OpenSpan file. You can extract the folder from that using standard methods. Then combine the folder with your file name to build the filepath to copy.
I will put up another post to show you how to do that shortly.
Here is the late example on how to copy the file from your deployment package to a location on the computer. Remember the user must have permission to do the file copy or it will fail.
First we need to add a few new static methods to the toolbox. To do that select Choose Items from the right click menu on the toolbox. From there choose the Pega Robotics Static Methods tab. Check the From Global Assembly Cache radio button and the select "mscorlib" from the Assembly dropdown. Make the following selections:
Now you can write a simple automation using these methods to find your file in the deployment extract folder and copy it to your preferred location. It would look something like this.