Var CustomBits

${SegmentFile}

${Segment.OnInit}
	; Borrowed the following from PAL 2.2, Remove on release of PAL 2.2
		; Work out if it's 64-bit or 32-bit
	System::Call kernel32::GetCurrentProcess()i.s
	System::Call kernel32::IsWow64Process(is,*i.r0)
	
	${If} $0 == 0
	${OrIf} ${IsWinVista}
	${OrIf} ${IsWinXP}
		StrCpy $CustomBits 32
	${Else}
		StrCpy $CustomBits 64
	${EndIf}
	StrCpy $Bits $CustomBits
!macroend

${SegmentInit}
	StrCpy $Bits $CustomBits

    ${If} $Bits = 64
        ${SetEnvironmentVariablesPath} FullAppDir "$EXEDIR\App\DetectItEasy64"
	${Else}
        ${SetEnvironmentVariablesPath} FullAppDir "$EXEDIR\App\DetectItEasy32"
	${EndIf}
!macroend
