Indigo Rose Software
  #1  
Old 03-20-2008
jlsf2 jlsf2 is offline
Forum Member
 
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.
Reply With Quote
  #2  
Old 03-20-2008
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
You could do that from the TrueUpdate server script using Folder.Delete actions.
__________________
--[[ Indigo Rose Software Developer ]]
Reply With Quote
  #3  
Old 03-20-2008
jlsf2 jlsf2 is offline
Forum Member
 
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...
Reply With Quote
  #4  
Old 03-20-2008
jlsf2 jlsf2 is offline
Forum Member
 
Join Date: May 2007
Posts: 101
BTW, when do legacy files get deleted? Does it happen before the "On Post Patch" actions?

Thanks.
Reply With Quote
  #5  
Old 03-20-2008
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
Do you mean with Visual Patch 3.0? (Your original post didn't specify. )
__________________
--[[ Indigo Rose Software Developer ]]
Reply With Quote
  #6  
Old 03-20-2008
jlsf2 jlsf2 is offline
Forum Member
 
Join Date: May 2007
Posts: 101
Ahhh yeah, I posted in the wrong forum.

VP3.
Reply With Quote
  #7  
Old 03-20-2008
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
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 ]]
Reply With Quote
  #8  
Old 03-20-2008
jlsf2 jlsf2 is offline
Forum Member
 
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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


All times are GMT -6. The time now is 03:42 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software