tags:

views:

39

answers:

2

To support Window Vista in my game, I have changed were the save files are placed (From under Program Files to My Documents) for both XP and Vista installations.

Now I would like to be able to move the current XP users save games from the old location to the new location.

I think I can correctly trigger this via the upgrade checking code like so:

<Upgrade Id="PLACE-GUID-HERE">
  <UpgradeVersion OnlyDetect="yes" Minimum="$(var.ProductVersion)" IncludeMinimum="no" Property="NEWERVERSIONDETECTED" />
  <UpgradeVersion OnlyDetect="no" Minimum="1.1.0" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED" />
  <UpgradeVersion OnlyDetect="no" Maximum="1.1.0" IncludeMaximum="no" Property="MOVESAVEFILESUPGRADED" />
</Upgrade>

where 1.0.x was the old way and 1.1.x will be the new way, thus I could do something in a custom action based on MOVESAVEFILESUPGRADED, but the heart of the problem, I cant see how to move non-installed files from one location to another.

+1  A: 

I dont think there is a built in custom action that will do that.If you write your own its best to use a dll, but vbscript or bat file will also do the job.

This might help

Charles Gargent
That vbscript option seams to be exactly what I need
Simeon Pilgrim
+1  A: 

Use the CopyFile element. A custom action is overkill and VBScript custom actions are unreliable. See http://www.joyofsetup.com/2007/06/07/when-vbscript-and-jscript-custom-actions-are-even-more-evil/.

Bob Arnson
Good points from the blog post regarding scripts short comings. Also the system I'm really moving the configurations on is XP not Vista, thus it might make sense to just do it in the game process, rather than in the installer. I was thinking of the installer as it's a one time gated process, verse have to check each time ran.
Simeon Pilgrim