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\\' $R0You'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: https://portableapps.com/node/15915
- OliverK's blog
- Log in or register to post comments
Comments
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.
Sweet, I was hoping it would
Sweet, I was hoping it would help