A useful bit of code . . .

Submitted by OliverK on September 29, 2008 - 6:22pm
SkipSplashScreen:
		;=== Check for data files
		IfFileExists "$PROGRAMDIRECTORY\config.conf" GetPassedParameters ;=== settings already in program directory
		IfFileExists "$SETTINGSDIRECTORY\config.conf" MoveSettings ;=== settings found in data directory
		
		;=== Copy the default settings files
		StrCmp $DEFAULTLOCATION "true" "" GetPassedParameters ;=== if not default location, user is on their own
		CreateDirectory "$SETTINGSDIRECTORY"
		CopyFiles /SILENT "$EXEDIR\App\DefaultData\settings\*.*" "$SETTINGSDIRECTORY\"
		;${StrReplace} $0 '\' '/' '$PROGRAMDIRECTORY\bin\ffmpeg.exe' ;you don't usually need these, unless the app is . . .  funny :D
		;${StrReplace} $1 '/' '\\' '$FFMPEGPATH'
		${ConfigWrite} "$SETTINGSDIRECTORY\config.conf" "ffmpegLibLocation=" "$FFMPEGPATH" $R0
		${GetRoot} $EXEDIR $0
		${DirState} "$0\Documents\Videos\" $VIDEOEXIST
		StrCmp $VIDEOEXIST "-1" SetAtRoot SetAtVideos
		       SetAtVideos:
                                   ${ConfigWrite} "$SETTINGSDIRECTORY\config.conf" "downloadDir=" '$0\\Documents\\Videos\\' $R0
                                   Goto MoveSettings
                        SetAtRoot:
                                  ${ConfigWrite} "$SETTINGSDIRECTORY\config.conf" "downloadDir=" '$0\\' $R0

You'll need to include the macros for GetRoot, DirStat, ConfigWrite, and StrReplace.

You could use this any application . . . Such as setting up a defualt location in a app. . . Like HM NIS Edit . . . Or like I did in this app, posted here: http://portableapps.com/node/15915


Nice. I think first I'll get

Nice. I think first I'll get around to merging MenuLauncher and mkshortcuts, but then integrating this into HM NIS Edit Portable will be top priority.

Australia's Great Dividing Range : Dividing From What?
Patrick Patience is a key virtue.
behold, return of taneth111! (insert darth vader music here)

Sweet, I was hoping it would

Sweet, I was hoping it would help :D

Good gracious! There goes a kangaroo. I must have a practice with me boomerang- Now then, slowly back
If you throw that thing at me, I'll jump right on your head.
Innit marvellous? Got a land full of kangaroos and I had to pick that one.