Saving a temporary copy of a file before deploy and then restoring it after.

Comments

4 comments

  • Luke Nichols

    Jim,

    Maybe I'm missing something, but couldn't you just do a file copy step before the install step that renames/moves the file, then another file copy step after the install step that renames/moves it back?

    1
    Comment actions Permalink
  • Jhoffman

    That's what I was going to do but it looks like that only copies files from the server to the destination computer.  I just want to copy it from one folder to another on the destination computer.  Or, are you suggesting copying it up to the server and then back down again?  I guess that could work.

    1
    Comment actions Permalink
  • Luke Nichols

    Jim,

    You could copy it up to the server and back down but that seems unnecessary. I didn't consider that the file copy step assumes you're copying from the server, in that case I would just use a command step instead. Something like this for the before step, with the two variables in the move command swapped for the after step:

     

    1
    Comment actions Permalink
  • Ryan Corrigan

    This is what I use for our shipping software. Our machines have different configs for printers, but the file is the same. I copy the config file off and rename it to the computer name, and then can easily copy it back by calling it with the computer name variable. 

    In your case, run this as step 1:

    ECHO F | xcopy /y "C:\Program Files\AppConfig\file.txt" \\SERVER\SHARE$\%computername%.txt

    Run this at the end:

    ECHO F | xcopy /y \\SERVER\SHARE$\%computername%.txt "C:\Program Files\AppConfig\file.txt"

    1
    Comment actions Permalink

Please sign in to leave a comment.