${SegmentFile}

${Segment.OnInit}
	${IfNot} ${FileExists} "$SYSDIR\d3dx9_43.dll"
		MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON1 `This app requires specific versions of DirectX installed on the local machine which are not currently installed. Would you like to install it now (requires admin rights)?` IDYES CustomDirectXCheckGotoURL IDNO CustomDirectXCheckGotoAbort

			CustomDirectXCheckGotoURL:
			MessageBox MB_OK|MB_ICONINFORMATION `The DirectX installer will now run. When complete, you can run the app again.$\r$\n$\r$\nNote: Uncheck the 'Protect my computer...' option if present as it will break the DirectX installer.` IDYES CustomDirectXCheckGotoURL IDNO CustomDirectXCheckGotoAbort
			ExecShell "runas" `"$EXEDIR\App\BYOND\directx\DXSETUP.exe"`
						
			CustomDirectXCheckGotoAbort:
			Abort
	${EndIf}
!macroend