Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

how to backup a file before removing for upgrading


4 replies to this topic

davidxie

davidxie
  • Full Members
  • 2 posts

Posted 12 December 2008 - 17:18


In my project, we need to update the software. If the old version is installed, i need to have it backuped. In the intall shield file, it first removes the existing files before coping from new version and then copy the files in new version. I added a custom action

working directory= WindowFolder
Filename & command line = cmd.exe /c "C:\Program Files\SiiDRILL\Yield Point\installation.bat"
return processing = Synchronous (check exit code)
In-Script Execution = Immediate execution
Execution Scheduling = Always execute
Install Exec Sequence = after installValidate

In the installation.bat :

IF NOT EXIST "C:\Program Files\SiiDRILL\Yield Point\YPData5.mdb" GOTO ENDPROG
mkdir "C:\Program Files\SiiDRILL\Yield Point\BACKUP"
copy "C:\Program Files\SiiDRILL\Yield Point\YPData5.mdb" "C:\Program Files\SiiDRILL\Yield Point\BACKUP\YPData5.mdb"

:ENDPROG
Cls

It failed to copy the database before removing the old files.

Could you please give me some advise.


Thank you very much.

I’m looking forward to hearing from you.


vijayakumar

vijayakumar
  • Full Members
  • 43 posts

Posted 15 December 2008 - 09:45

Hi,

try giving the working folder as System 32 director property

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 December 2008 - 18:10

Does C:\Program Files\SiiDRILL\Yield Point\installation.bat exist at the time when you callö the custom action? So it was put there by the old version?

davidxie

davidxie
  • Full Members
  • 2 posts

Posted 15 December 2008 - 20:50

installation.bat is include in the "file and folder" in the basic msi project.
maybe it is not copied by the system to the location before the custom action.


I tried to use installation.bat to launch the install, (the batch file calls setup.exe).
Then it works.

I'm wondering how to use custom action to finish the coping function.

i also tried to use system search as the condition for custom action. However, it does not work for brand new installation. It quits the installation.

Should I include the script function for the custom action?

Thank you very much.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 17 December 2008 - 15:36

If I understand correctly, yuo want to save the old files before installing the new files. If you install this bat as part of the new files you can't call it before you're installing the new files obviously. Instead of installing the bat file (in the Files and Folders view) add it to the support files section of your release.