7 Replies Latest reply on Apr 7, 2009 4:45 AM by zman

    Deleting empty folder - LANDesk Package Builder

    Rookie

      Hello People,

       

      I am using the LANDesk Package Builder to create Install and Uninstall packages for the LD Managment Suit.

      I have a problem:

       

      I am creating an uninstaller, now. It should delete one or more folder, if they're emtpy. If there're some files in these folders, they must not be deleted.

      The delete function erases everything. And there is no If condition wich checks filesizes and so on...

      I tried this:

      If isFile(*, myFolder)

      REM nothing todo, because there are files in myFolder --> * == Wildcard ?

      ELSE

      delete myFolder

      EndIf

       

      But dont really work...

       

      If anybody can help.. I'd be grateful..

       

      fismoll

        • 1. Re: Deleting empty folder - LANDesk Package Builder
          phoffmann SupportEmployee

          Urm - why exactly are you using Package builds what what is already quite well managed by MSI?

           

          I'm a bit confused as to why you would want to Package Builder the whole suite - so a bit more info and background would be helpful, as otherwise it's looking like you're using the wrong tool for the wrong task here, I think.

           

          There may well be a good reason for what you do and the way you do it, it'd just help knowing what you're trying to do and (especially) why - we can give better advice then.

           

          Paul Hoffmann

          LANDesk EMEA Technical Lead

          • 2. Re: Deleting empty folder - LANDesk Package Builder
            Rookie

            >>>Urm - why exactly are you using Package builds what what is already quite well managed by MSI?

            NO, it's not quite managed by the MSI!

             

            >>I'm a bit confused as to why you would want to Package Builder the whole suite - so a bit more info and background would be helpful, as otherwise it's looking like you're using the wrong tool for the wrong task here, I think.

            Why do you scratch you head with nonsense questions? Why I am using the whole suite..blablaa!`??

            There is nothhing more you need to know to answer my question! I asked a simple question here:

            I want to know, if there is a functionality in the LD Package Builder to erase ONLY AND ONLY empty folders?

            If you cannot answer this, please do not reply here!

             

            >>There may well be a good reason for what you do and the way you do it, it'd just help knowing what you're trying to do and (especially) why - we can give better advice then.

            NO! You don't need more to know to answer this simple question!

             

            I asume that this simple functionality is not provided in the LD Package Builder?

            I solved it already with AutoIT!

            • 3. Re: Deleting empty folder - LANDesk Package Builder
              phoffmann SupportEmployee

              Whoa - easy there, fella.

               

              I point you to your first line:

              ""

              I am using the LANDesk Package Builder to create Install and Uninstall packages for the LD Managment Suit.

              ""

               

              ... which to me read as if you were trying to capture either the whole LANDesk Management Suite install (or one of the sub components) via package builder, which does happen to be all MSI based.

               

              Relax.

               

              It's "a simple question" as you state, because you know what you're asking. Reading your original post, it's evidently possible to interpret what you're after in multiple ways. No reason to start and get snotty over what was a simple request to clarify things.

              • 4. Re: Deleting empty folder - LANDesk Package Builder
                zman Master

                isFile does not support wildcards. So you will either have to look for a particular file, or simply create a batch file and do a runatexit to exercise this logic.

                1 of 1 people found this helpful
                • 5. Re: Deleting empty folder - LANDesk Package Builder
                  mrspike SSMMVPGroup

                  Wow!

                   

                  The LANDesk community stands out from a lot of other user groups / forums / bulletin boards for many reasons.  Two of the big ones are, you can usually get an answer to your questions quickly (and free) and we all (or mostly) treat everyone from the most knowledgeable down to utmost beginner with the same level of respect.

                   

                  Paul has earned 5 out 5 stars from other users because he is one of the most helpful folks out there.  He spends a lot of his own time answering questions, sometimes repeatedly becuase a search was not performed before asking, and he does so kindly.

                   

                  When Paul does ask some questions before supplying an answer he usually has good reason to.

                   

                  I hope that you find this site can be full of great information and that your next session is more pleasant.

                  • 6. Re: Deleting empty folder - LANDesk Package Builder
                    Rookie

                    Wow.. Zman has also earned 5 out 5 stars and he could answer my simple question without requisitioning my whole curriculum vitae..

                     

                    I am sorry, when I troubled someone, but I do not like it, when I ask "What is 1+1" and someone responds "Oh... I need your whole life story and a harddisk-image to answer this"

                     

                    Be that as it may, this is going to become offtopic. I have the information I wanted, thnx.

                     

                    LD Package Builder can not erase folders, only if they're empty and I have solved my problem alternatively already.

                    • 7. Re: Deleting empty folder - LANDesk Package Builder
                      zman Master

                      Man don't drag me into this one Also, semantics play a big part in interpreting the intent of the poster.  As an example:

                       

                      LD Package Builder can not erase folders, only if they're empty

                       

                      There are multiple ways to interpret this statement:

                       

                      1. PB can not delete folders unless they are empty.
                      2. PB has problems programmatically determining if a folder is empty then deleting the folder.

                       

                      Also, we all have our areas of expertise. I have lived and ate PB since the old 20/20 days so I'm very familiar with it so I was able to understand the intent of your question. Fis4Test, it is very difficult sometimes to understand the questions raised by the community - speaking from personal experience.  Paul and others try their best to make this a great place for LANDesk users to get help, and in the end that is what happened. I have also asked for background on questions - many times to help me not only understand the requirements, but possibly offer a better solution. Not to speak for Paul, but I think that was his intent.

                       

                      BTW, on a personal note - glad you chose autoit.