Try the following and let me know if it works the way you expected.
Firstly Create a “make_mod.cmd” file locally with the command @ECHO OFF
- Create a package using the “New package wizard”
- Include the details, pre-req rule, download instructions.
- In the select package screen, check “Use package boot helper program” and “include additional files within the package”
- Click on the packageboot icon, delete the pre-defined actions and add action “Run a program” under “before applying package”. (Note: If you want the directory to get created after installing the package” choose to add the action under “After applying package”.)
- Under the added “run a program” action check the options “Enable this action” and “Run program”.
- Give “cmd.exe” in the Program name.
- In the command line parameters give : /c %MODULEPATH%\make_mod.cmd
- Check “Stop processing further actions if this action fails”
- Save the xml.
- Expand the additional files menu and add the “make_mod.cmd” file created in step 1.
- Save the package with the app and installed rules.
Publishing and updating the package with the packageboot of the above instructions will create a folder “Myfolder” in C drive.
Let me know if you need more information.
Additionally, whenever you utilize the "Includes additional files with the package" option the content will be pulled into your custom package in the the same directory structure it's currently in. This can be particularly helpful whenever you have installation package dependencies on additional folder content required for the proper execution of the update.
I didn't try that specifically but I did try to use Package boot. It looks like it has what I want to do in one very convient place. The only problem is that it didn't run my pre-requisit program and it ran the main program but not using the switches I provided in the package boot parameters. I used the /verysilent switch and it still prompted me to download the pre-requisit progrm. Maybe it didn't install? It should have if the entire directory was included with the setup.exe.
I've tried adding the directory using "Include additional files with the package" but it never installes the directory. What is suppose to happen is the directory gets copied to Program Files but after the update installs and says it has done so correctly that directory does not exist. Searching the C:\ drive turns up nothing but my original install files and nothing in the program files directory.
New topic or continue here?
I want to check to see if when I'm including a directory if it's including the root folder and all sub folders or if it's just adding the content of the root folder and keeping the sub folder structure intack. Where would I go about finding this information out?
I figured it out. The root directory selected to be added is ignored so the directory you wish to add needs to be in directory you don't want to be attached. I'm seeing this directory in the c:\windows\softwaredistribution\download\install folder.
Just wanted to add that when trying to deploy custom packages that were previously deployed using SMS and VBScript, I had to remove any existing folder paths in the script.
The tricky part was with deployment if you had 2 files with the same name, but needed to go to different directories.
Resolved that by renaming one of the files and then calling a custom .cmd file with the following:
echo f | xcopy "%dp0newfilename.ext" "%ProgramFiles%\DIRECTORYPATH\originalfilename.ext" /h /e /y /z /r /i
That will take the file and put it in the destination place, creating the directory path along the way.
Piping the echo f, solves the problem of xcopy's prompt of the destination being a file or a directory.
Hope that helps someone.