PDA

View Full Version : Can't get File.Rename to work



fsgenesis
03-19-2010, 08:24 AM
Trying to rename files on the destination system but can't make it work.

Here's what I'm using in the Post-install phase:

File.Rename(SessionVar.Expand("%AppFolder%\\Scenery\Eurw\Scenery\HL945060.bgl", "%AppFolder%\\Scenery\Eurw\Scenery\HL945060.FSG"));

It's throwing up an error when I run the installer:

On Post Install, Line 1: 2 arguments required

Can some one please point out my error?

Thanks in advance

Justin

fsgenesis
03-19-2010, 09:42 AM
No longer getting the 2 arguments error, but this isn't working either:

File.Rename(SessionVar.Expand("%AppFolder%\\Scenery\Eurw\Scenery\HL945060.bgl"), (SessionVar.Expand("%AppFolder%\\Scenery\Eurw\Scenery\HL945060.FSG")));

just need to change the extension on some files.

Arrghhh (as he beats his head against the wall)

Justin

fsgenesis
03-19-2010, 11:17 AM
Never mind. My head hurts but finally got this to work:

File.Rename(SessionVar.Expand("%RenFolder%\\Scenery\\Eurw\\Scenery\\HL945060.bgl"), "%RenFolder%\\Scenery\\Eurw\\Scenery\\HL945060.FSG");

forgot my escape slashes