7 Replies Latest reply on Jan 2, 2013 5:01 PM by ak00

    Do directories get added to Custom Packages?

    dkeyser

      The thing that needs to happen is I need to add a directory structure to a custom package. Will this directory get recreated on the target machine when it runs this package? I'd assume so but just want to confirm.

        • Re: Do directories get added to Custom Packages?
          Pooranivalli Kumaravelu

          Hi dkeyser,

          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

            mkdir C:\Myfolder

          1. Create a package using the “New package wizard”
          2. Include the details, pre-req rule, download instructions.
          3. In the select package screen, check “Use package boot helper program” and “include additional files within the package”
          4. 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”.)
          5. Under the added “run a program” action check the options “Enable this action” and “Run program”.
          6. Give “cmd.exe” in the Program name.
          7. In the command line parameters give :  /c %MODULEPATH%\make_mod.cmd
          8. Check “Stop processing further actions if this action fails”
          9. Save the xml.
          10. Expand the additional files menu and add the “make_mod.cmd” file created in step 1.
          11. 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.

          Regards,

          Poorni

            • Re: Do directories get added to Custom Packages?
              David Di Blasio

              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.

              • Re: Do directories get added to Custom Packages?
                dkeyser


                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.

              • Re: Do directories get added to Custom Packages?
                dkeyser

                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?

                • Re: Do directories get added to Custom Packages?
                  dkeyser

                  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?

                  • Re: Do directories get added to Custom Packages?
                    dkeyser

                    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.

                    • Re: Do directories get added to Custom Packages?
                      ak00

                      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.