${SegmentFile}

${SegmentPrePrimary}
	${If} ${FileExists} "$EXEDIR\Data\settings\PixeloramaPortableSettings.ini"
		ReadINIStr $0 "$EXEDIR\Data\settings\PixeloramaPortableSettings.ini" "PixeloramaPortableSettings" "DataVersion"
		ReadINIStr $1 "$EXEDIR\App\AppInfo\appinfo.ini" "Version" "PackageVersion"
		${If} $0 != $1
			CopyFiles /SILENT "$EXEDIR\App\DefaultData\pixelorama_data\*.*" "$EXEDIR\Data\pixelorama_data"
			WriteINIStr "$EXEDIR\Data\settings\PixeloramaPortableSettings.ini" "PixeloramaPortableSettings" "DataVersion" $1
		${EndIf}
	${EndIf}
!macroend

${SegmentPostPrimary}
	ReadINIStr $0 "$EXEDIR\Data\settings\PixeloramaPortableSettings.ini" "PixeloramaPortableSettings" "DataVersion"
	ReadINIStr $1 "$EXEDIR\App\AppInfo\appinfo.ini" "Version" "PackageVersion"
	${If} $0 != $1
		WriteINIStr "$EXEDIR\Data\settings\PixeloramaPortableSettings.ini" "PixeloramaPortableSettings" "DataVersion" $1
	${EndIf}
!macroend
