You are here

Saving Multiple Files

5 posts / 0 new
Last post
App Guy
Offline
Last seen: 11 years 2 months ago
Joined: 2008-03-16 14:24
Saving Multiple Files

I am trying to make a launcher for FSViewer. It saves folders and files in the directory. How do I make code to move it to the Data folder.

OliverK
OliverK's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2007-03-27 15:21
http://portableapps.com/node/

https://portableapps.com/node/14868

I would suggest checking out the code in NotePad++ for this item.

SkipSplashScreen:
		;=== Check for data files
		IfFileExists "$PROGRAMDIRECTORY\config.xml" GetPassedParameters ;=== settings already in program directory
		IfFileExists "$SETTINGSDIRECTORY\config.xml" MoveSettings ;=== settings found in data directory
MoveSettings:
		Rename "$SETTINGSDIRECTORY\config.xml" "$PROGRAMDIRECTORY\config.xml"
		Rename "$SETTINGSDIRECTORY\contextMenu.xml" "$PROGRAMDIRECTORY\contextMenu.xml"
		Rename "$SETTINGSDIRECTORY\ConvertExt.enc" "$PROGRAMDIRECTORY\ConvertExt.enc"
		Rename "$SETTINGSDIRECTORY\ConvertExt.ini" "$PROGRAMDIRECTORY\ConvertExt.ini"
		Rename "$SETTINGSDIRECTORY\ConvertExt.lng" "$PROGRAMDIRECTORY\ConvertExt.lng"
		Rename "$SETTINGSDIRECTORY\insertExt.ini" "$PROGRAMDIRECTORY\insertExt.ini"
		Rename "$SETTINGSDIRECTORY\LightExplorer.ini" "$PROGRAMDIRECTORY\LightExplorer.ini"
		Rename "$SETTINGSDIRECTORY\NPPTextFX.ini" "$PROGRAMDIRECTORY\NPPTextFX.ini"
		Rename "$SETTINGSDIRECTORY\QuickText.ini" "$PROGRAMDIRECTORY\QuickText.ini"
		Rename "$SETTINGSDIRECTORY\session.xml" "$PROGRAMDIRECTORY\session.xml"
		Rename "$SETTINGSDIRECTORY\shortcuts.xml" "$PROGRAMDIRECTORY\shortcuts.xml"
		Rename "$SETTINGSDIRECTORY\SpellChecker.ini" "$PROGRAMDIRECTORY\SpellChecker.ini"
		Rename "$SETTINGSDIRECTORY\stylers.xml" "$PROGRAMDIRECTORY\stylers.xml"
		Rename "$SETTINGSDIRECTORY\nativeLang.xml" "$PROGRAMDIRECTORY\nativeLang.xml"
		Rename "$SETTINGSDIRECTORY\plugins\NPPTextFX.ini" "$PROGRAMDIRECTORY\plugins\NPPTextFX.ini"

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

digitxp
digitxp's picture
Offline
Last seen: 13 years 3 months ago
Joined: 2007-11-03 18:33
Hm...

Maybe a *.ini *.xml *.lng *.enc would be faster and easier to manage.

Insert original signature here with Greasemonkey Script.

App Guy
Offline
Last seen: 11 years 2 months ago
Joined: 2008-03-16 14:24
Default Data Folder

Could I put it in the Default Data folder and add code to save files there and move them to the data directory.

May the Shwartz be with you

OliverK
OliverK's picture
Offline
Last seen: 3 years 6 months ago
Developer
Joined: 2007-03-27 15:21
SkipSplashScreen: ;===
SkipSplashScreen:
		;=== Check for data files
		IfFileExists "$PROGRAMDIRECTORY\config.xml" GetPassedParameters ;=== settings already in program directory
		IfFileExists "$SETTINGSDIRECTORY\config.xml" 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\"
		CreateDirectory "$SETTINGSDIRECTORY\plugins"
		CopyFiles /SILENT "$EXEDIR\App\DefaultData\settings\plugins\*.*" "$SETTINGSDIRECTORY\plugins\"
		CreateDirectory "$SETTINGSDIRECTORY\plugins\config"
		CreateDirectory "$SETTINGSDIRECTORY\plugins\NPPTextFX"
		CopyFiles /SILENT "$EXEDIR\App\DefaultData\settings\plugins\NPPTextFX\*.*" "$SETTINGSDIRECTORY\plugins\NPPTextFX"

Notice how it checks.

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

Log in or register to post comments