Community Forums
Results 1 to 2 of 2

Thread: Quick delete of previous installs file maked Permanent

  1. #1
    Join Date
    Oct 2010
    Posts
    5

    Question Quick delete of previous installs file maked Permanent

    In a previous install a file was marked as Permanent.
    I would like to delete the file and put a new one in it's place during a full major update MSI installation.
    I was thinking about creating a CA to do this, but was working where I'd place it or if there is another way.
    Any suggestions?

    Kevin

  2. #2
    Join Date
    Oct 2010
    Posts
    5

    Solution

    Quote Originally Posted by ktbrownusa View Post
    In a previous install a file was marked as Permanent.
    I would like to delete the file and put a new one in it's place during a full major update MSI installation.
    I was thinking about creating a CA to do this, but was working where I'd place it or if there is another way.
    Any suggestions?

    Kevin
    I created a CA that runs after Unpublish Features. This way the full uninstall has been completed if this is a major uninstall.
    I put in the conditions REMOVE <> "ALL" so it doesn't run at the uninstall, just for the Install.

    Sychronous
    Immediate execution
    Always Execute

    Script as follows:

    'This routine finds the permanent file and removes it by backing it up.
    'Then the install will place the new file

    Dim fso, FileConfig

    FileConfig = "TheActualFileName"

    DataDir = Session.Property("CommonAppDataFolder") & "Company\DataDirectory\"

    On error resume next

    Set fso = CreateObject("Scripting.FileSystemObject")

    'If we haven't updated the the file to new one

    'This is only for this move. If the back up exsits, we do not need to do it again

    'MsgBox DataDir & FileConfig & "_Backup " & "|" & DataDir & FileConfig

    If Not fso.FileExists (DataDir & FileConfig & "_Backup") then

    fso.MoveFile DataDir & FileConfig, DataDir & FileConfig & "_Backup"

    End If

Tags for this Thread

Posting Permissions

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