Results 1 to 10 of 19

Thread: Web update issues

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #19

    Default Re: Web update issues

    Our current update included the deletion of over 1400 files (mostly unused textures that we purged from source control). I decided that manually entering delete file or delete folder blocks for all of them is too much work and came up with a workaround.

    I get a list of files from a directory diff, saving the list to a text file "delete.txt". Each file is listed as e.g. ".\data\textures\faketexture.bmp". The diff tool lists files with the diff root as '.' automatically. On subsequent updates I will append the new list at the end of this file, so users upgrading from v.1 to v.3 don't miss the files deleted in v.2.

    I created a batch file containing:
    @echo off

    for /f "delims=" %%i in (delete.txt) do (
    del "%%~fi" 2>nul
    rd "%%~dpi" 2>nul
    )
    This batch file iterates through the files listed in delete.txt, deleting each and attempting to remove the subdirectory if the deletion emptied it.

    "delims=" replaces the default delimiter set (space and tab) with an empty set. This ensures that each line is treated as a single whole entry. Without this, the batch can't delete a file containing a space.

    "%%~fi" expands each entry to a fully qualified path, enclosed in quotes. "%%~dpi" expands each entry to a drive letter and path with no file name, enclosed in quotes. The quotes are important in case the user has installed to a path with spaces in, which is likely.

    2>nul throws away all error output, so the user doesn't see "Could not find foo" for files that don't exist or "The directory is not empty" if the file was not the last in the directory.

    In my SetupBuilder script, I added
    Install File "C:\Installer\delete.bat" to %_SB_INSTALLDIR%\delete.bat
    Install File "C:\Installer\delete.txt" to %_SB_INSTALLDIR%\delete.txt
    Run Program %_SB_INSTALLDIR%\delete.bat (Always Install) (Wait)
    Delete Local Files "%_SB_INSTALLDIR%\delete.bat"
    Delete Local Files "%_SB_INSTALLDIR%\delete.txt"
    The Run Program entry has 'Hide Window' checked, and 'Default Directory' set to "%_SB_INSTALLDIR%". The default directory ensures that when delete.bat runs, its current directory corresponds to the root of the files in delete.txt

    I placed these lines in the [ Install Files ] section, before the Install File *.* line. In this way, if a file gets deleted and later re-added, it will end up being downloaded again, but is ensured to end up in the final installation.
    Last edited by timbojones; 02-15-2006 at 05:30 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Web Update
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 7
    Last Post: 10-03-2006, 04:41 AM
  2. SetupBuilder 5.5 Update Information [July 11, 2006]
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 2
    Last Post: 07-13-2006, 07:04 AM
  3. Configure iDeploy Web Update
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 1
    Last Post: 05-17-2006, 02:36 AM
  4. Web Update Issues?
    By Unregistered in forum SetupBuilder
    Replies: 2
    Last Post: 11-14-2005, 09:48 AM
  5. SetupBuilder 5 (beta) Web Update feature "update"
    By linder in forum SetupBuilder
    Replies: 0
    Last Post: 10-04-2004, 05:15 AM

Tags for this Thread

Posting Permissions

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