Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    May 2007
    Posts
    101

    removal of legacy folders

    My patcher removes legacy files just fine... but it leaves the empty directory structure installed. Anyway to have that removed automatically as well?

    Thanks.

  2. #2
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    You could do that from the TrueUpdate server script using Folder.Delete actions.
    --[[ Indigo Rose Software Developer ]]

  3. #3
    Join Date
    May 2007
    Posts
    101
    Yeah, I was hoping to avoid that.

    The current scenario where the files just get deleted automatically is the best.

    I can use Folder.Delete like you suggested, but that requires me to have knowledge of what is being removed. Unless I just go through and recursively delete any empty folder...

  4. #4
    Join Date
    May 2007
    Posts
    101
    BTW, when do legacy files get deleted? Does it happen before the "On Post Patch" actions?

    Thanks.

  5. #5
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    Do you mean with Visual Patch 3.0? (Your original post didn't specify. )
    --[[ Indigo Rose Software Developer ]]

  6. #6
    Join Date
    May 2007
    Posts
    101
    Ahhh yeah, I posted in the wrong forum.

    VP3.

  7. #7
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    No worries...

    PATCH_STAGE_REMOVING_LEGACY_FILES happens right after PATCH_STAGE_PATCHING_FILES in the patching sequence.

    So, right after all of the files are patched.

    (I would have just said so above, but I was checking the source code to make sure. )

    It goes like this:
    1. Initialize some Lua variables (_CommandLineArgs, %SourceFolder%, etc.)
    2. Begin the log file.
    3. Initialize the language support.
    4. Verify the file archive integrity.
    5. Load action plugins.
    6. Do any Global Script includes.
    7. Run the Global Functions script.
    8. Run the On Startup actions.
    9. Show the Before Patching screens.
    10. Run the On Pre Patch actions.
    11. Start writing the log file to disk.
    12. Show While Patching screen.
    13. Patch files.
    14. Remove legacy files.
    15. Handle any files that need to be deleted or moved on reboot.
    16. Destroy the progress screen controller.
    17. Run the On Post Patch actions.
    18. Show the After Patching screens.
    19. Run the On Shutdown actions.
    20. Delete any temp files.
    21. Exit the patch.
    --[[ Indigo Rose Software Developer ]]

  8. #8
    Join Date
    May 2007
    Posts
    101
    In case anyone needs this:

    --[[
    ************************************************** ********************************
    Function: RemoveEmptyFolders
    Purpose: Recursively remove empty folders starting from the given folder.
    Arguments: (string) rootFolder
    Returns: nothing
    ************************************************** ********************************
    --]]
    function g_RemoveEmptyFolders( rootFolder )

    folders = Folder.Find( rootFolder, "*", false, nil );

    if ( folders ) then
    -- recursively remove empty folders
    for i, folderName in folders do
    g_RemoveEmptyFolders( folderName );
    end
    end

    -- All of the empty sub-folders have been removed. Do one last check to see
    -- if this folder has files or folders in it, if not, then remove it.
    folders = Folder.Find( rootFolder, "*", false, nil );
    files = File.Find( rootFolder, "*.*", false, false, nil, nil );

    if ( (not folders) and (not files) ) then
    -- This folder is also empty. Remove it.
    Debug.Print( "Folder to be removed: " .. rootFolder .. "\r\n" );
    Folder.Delete( rootFolder );
    end
    end

Similar Threads

  1. legacy files seem to behave wrong for multi versions
    By rjfioravanti in forum Visual Patch 3.5 Discussion
    Replies: 1
    Last Post: 11-12-2007, 01:04 PM
  2. delete legacy files
    By zebra in forum Visual Patch 2.0
    Replies: 3
    Last Post: 01-30-2007, 08:52 AM
  3. Folders and subfolders
    By kallumama in forum Setup Factory 7.0
    Replies: 2
    Last Post: 01-12-2006, 03:09 PM
  4. Add folders to the list
    By bobbie in forum AutoPlay Media Studio 5.0
    Replies: 16
    Last Post: 06-27-2005, 02:45 PM
  5. INFO: Finding Shell Folders in the Registry
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-10-2002, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts