${SegmentFile}

${SegmentInit}
	ReadRegStr $0 HKLM "Software\Microsoft\Windows NT\CurrentVersion" "CurrentBuild"
	
	${If} $0 = 9200
		MessageBox MB_YESNO|MB_ICONQUESTION `${NamePortable} requires a free upgrade from Windows 8.0 to Windows 8.1 to run. Would you like to download Windows 8.1 now?` IDYES CustomDownloadWin8 IDNO CustomAbortDueToWin8
		
		CustomDownloadWin8:
			ExecShell "open" "https://www.microsoft.com/en-us/software-download/windows8ISO"
		
		CustomAbortDueToWin8:
		Abort
	${EndIf}
	
	
	${If} $0 < 10000
		;Windows 7/8/8.1
		${If} ${FileExists} "$EXEDIR\App\RSSGuardLegacy"
			Rename "$EXEDIR\App\RSSGuard" "$EXEDIR\App\RSSGuardModern"
			Rename "$EXEDIR\App\RSSGuardLegacy" "$EXEDIR\App\RSSGuard"
		${EndIf}
	${Else}
        ${If} ${FileExists} "$EXEDIR\App\RSSGuardModern"
			Rename "$EXEDIR\App\RSSGuard" "$EXEDIR\App\RSSGuardLegacy"
			Rename "$EXEDIR\App\RSSGuardModern" "$EXEDIR\App\RSSGuard"
		${EndIf}
	${EndIf}
!macroend