You are here

Moving directories in NSIS- Need Help

5 posts / 0 new
Last post
Espreon
Espreon's picture
Offline
Last seen: 11 years 8 months ago
Joined: 2006-09-29 18:23
Moving directories in NSIS- Need Help

Alright I am almost finished with MoinMoin Portable Beta 1 but when I launch it a second time it does not work, because the launcher is not moving the "wiki" folder in Data\settings to App\moinmoin

Here is the .nsi:

SkipSplashScreen:
		;=== Check for data files
                IfFileExists `$EXEDIR\Data\settings\wiki\` MoveSettings
                IfFileExists `$EXEDIR\Data\settings\wikiconfig.py` MoveSettings
		IfFileExists `$EXEDIR\Data\settings\*.*` MoveSettings
			CreateDirectory `$EXEDIR\Data\settings`

	MoveSettings:
		Rename `$EXEDIR\Data\settings\wiki\` `$EXEDIR\App\moinmoin\`
        Rename `$EXEDIR\Data\settings\wikiconfig.py` `$EXEDIR\App\moinmoin\wikiconfig.py`

	LaunchNow:
		SetOutPath `$EXEDIR\App\moinmoin`
		ExecWait `$EXEDIR\App\moinmoin\moin.exe`

		;=== Move settings back
                Delete `$EXEDIR\Data\settings\wikiconfig.py`
                Rename "$EXEDIR\App\moinmoin\wikiconfig.py" "$EXEDIR\Data\settings\wikiconfig.py"
                RMDir /r `$EXEDIR\Data\settings\wiki`
                Rename "$EXEDIR\App\moinmoin\wiki" "$EXEDIR\Data\settings\wiki"

What is the correct way of using the Rename command to move directories?

Patrick Patience
Offline
Last seen: 4 years 4 months ago
DeveloperModerator
Joined: 2007-02-20 19:26
Cut out the website line...

In your code and I'll help.

This line, VIAddVersionKey Comments "Allows ${APP} to be run from a removable drive. For additional details, visit ${WEBSITE}"
_______________________________________________
Wow, I just noticed I still had a signature, that's enough of that.

Espreon
Espreon's picture
Offline
Last seen: 11 years 8 months ago
Joined: 2006-09-29 18:23
Done.

" "

--
As all of ya should know Micro$oft is the Evil Empire, and Windows (a.k.a. Winblows or Windoze) is their greatest general, so please make a difference and install Linux or FreeBSD on yer Windows comp.

Patrick Patience
Offline
Last seen: 4 years 4 months ago
DeveloperModerator
Joined: 2007-02-20 19:26
No I mean here silly.

The pre-formatted code you posted, you screwed up the page. Blum

_______________________________________________
Wow, I just noticed I still had a signature, that's enough of that.

wraithdu
Offline
Last seen: 10 years 10 months ago
Developer
Joined: 2007-06-27 20:22
Here you are moving from

Here you are moving from \settings\wiki\ to \moinmoin\ -

MoveSettings:
	Rename `$EXEDIR\Data\settings\wiki\` `$EXEDIR\App\moinmoin\`

Here you are moving from \moinmoin\wiki\ to \settings\wiki\, but your source dir does not exist.

        Rename "$EXEDIR\App\moinmoin\wiki" "$EXEDIR\Data\settings\wiki"

Also note that the Rename operation will fail if the destination file\folder exists (per NSIS documentation).

Log in or register to post comments