Get the new PortableApps.com Platform 10.0: Gorgeous themes, a full portable app store and advanced functionality
Announcing the World's Best Flash Drive: The PortableApps.com Companion | Did you see a malware warning on Friday?

A useful bit of code . . .

Submitted by OliverK on September 29, 2008 - 5: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.

But there’s no sense crying over every mistake,
You just keep on trying till you run out of cake.

Sweet, I was hoping it would

Sweet, I was hoping it would help Laughing out loud

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world