Function at 0x40f510
Capabilities:
Check if file exists
Get common file path
Get file version info
Set environment variable

Disassembly:
mov eax, 0x422f00
call fcn.00414798
sub esp, 0x950
mov eax, dword [0x431d24]
push ebx
mov ebx, dword [ebp + 8]
push esi
xor eax, ebp
xor esi, esi
mov dword [ebp - 0x10], eax
push edi
mov dword [ebp - 0x938], ebx
mov dword [ebp - 0x934], esi
mov dword [ebp - 0x934], ebp
push 1
push dword [ebp - 0x934]
push str.int___cdecl_ReleaseSetupUIToTemp_wchar_t__
call fcn.0040c3f0
mov edi, eax
add esp, 0xc
cmp edi, esi
mov eax, 0x429600
jne 0x40f566
mov edi, eax
push esi
push esi
push esi
push esi
push eax
push 0x4295d0
push edi
lea ecx, [ebp - 0x95c]
call fcn.0040b233
mov dword [ebp - 4], esi
cmp edi, esi
jne 0x40f585
push ebp
pop ebp
cmp ebx, esi
je 0x40f8dc
xor eax, eax
mov edx, 0x81
mov word [ebp - 0x218], si
mov ecx, edx
lea edi, [ebp - 0x216]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [ebp - 0x830], si
mov ecx, edx
lea edi, [ebp - 0x82e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [ebp - 0x628], si
mov ecx, edx
lea edi, [ebp - 0x626]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x218]
push eax
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jbe 0x40f8a0
push edi
lea eax, [ebp - 0x830]
push eax
push dword [0x432e24]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jbe 0x40f8a0
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
lea eax, [ebp - 0x830]
push eax
call ebx
cmp eax, esi
mov dword [ebp - 0x934], eax
je 0x40f8a0
push edi
lea eax, [ebp - 0x830]
push eax
lea eax, [ebp - 0x628]
push eax
call fcn.00413ef8
add esp, 0xc
push dword [ebp - 0x934]
call dword [sym.imp.SHLWAPI.dll_PathRemoveExtensionW]
lea eax, [ebp - 0x628]
push eax
call ebx
push dword [ebp - 0x934]
mov ebx, dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call ebx
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp - 0x218]
push eax
call fcn.0040e305
pop ecx
push 0x3f
pop ecx
xor eax, eax
lea edi, [ebp - 0x92e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x93c]
push eax
lea eax, [ebp - 0x628]
push eax
mov word [ebp - 0x930], si
mov dword [ebp - 0x93c], esi
call sub.VERSION.dll_GetFileVersionInfoSizeW
mov edi, eax
cmp edi, esi
jbe 0x40f749
lea eax, [edi + edi + 2]
push eax
call fcn.00410fb6
cmp eax, esi
pop ecx
mov dword [ebp - 0x934], eax
je 0x40f749
push eax
push edi
push dword [ebp - 0x93c]
lea eax, [ebp - 0x628]
push eax
call sub.VERSION.dll_GetFileVersionInfoW
test eax, eax
je 0x40f73d
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x940]
push eax
push 0x424850
push dword [ebp - 0x934]
mov dword [ebp - 0x944], esi
call sub.VERSION.dll_VerQueryValueW
test eax, eax
je 0x40f73d
mov eax, dword [ebp - 0x940]
movzx ecx, word [eax + 0xc]
push ecx
movzx ecx, word [eax + 0xe]
push ecx
movzx ecx, word [eax + 8]
movzx eax, word [eax + 0xa]
push ecx
push eax
lea eax, [ebp - 0x930]
push str._d._d._d._d
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
push dword [ebp - 0x934]
call fcn.00413d59
pop ecx
lea eax, [ebp - 0x930]
push eax
lea eax, [ebp - 0x218]
push eax
call ebx
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40f7d3
lea eax, [ebp - 0x218]
push eax
push esi
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
test eax, eax
je 0x40f7d3
mov edi, 0x42958c
push edi
call fcn.0040655f
test eax, eax
pop ecx
jne 0x40f8dc
push 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._lasterror
lea eax, [ebp - 0x218]
push eax
push str._XmpSetup_create_ui_release_path_failed_path
push esi
push edi
call fcn.0040a727
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c98b
mov ecx, eax
call fcn.0040133c
jmp 0x40f8c7
xor eax, eax
mov word [ebp - 0x420], si
mov ecx, 0x81
lea edi, [ebp - 0x41e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x420]
push eax
call fcn.00414a86
pop ecx
pop ecx
push str..SetupUI.cab
lea eax, [ebp - 0x420]
push eax
call ebx
push esi
lea eax, [ebp - 0x420]
push eax
push str.SETUPUI
push 0x68
call fcn.0040d015
add esp, 0x10
test eax, eax
jne 0x40f856
mov edi, 0x42958c
push edi
call fcn.0040655f
test eax, eax
pop ecx
jne 0x40f8dc
push 1
push str._XmpSetup_save_ui_cab_failed
push esi
push edi
call fcn.0040a727
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c98b
jmp 0x40f8d5
lea eax, [ebp - 0x218]
push eax
push dword [ebp - 0x938]
call fcn.00414a86
pop ecx
pop ecx
push dword [ebp - 0x938]
call dword [sym.imp.SHLWAPI.dll_PathRemoveBackslashW]
push dword [ebp - 0x938]
push str.installworkdir
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x420]
push eax
call fcn.0040ea9f
pop ecx
pop ecx
mov esi, eax
jmp 0x40f8dc
mov edi, 0x42958c
push edi
call fcn.0040655f
test eax, eax
pop ecx
jne 0x40f8dc
push 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._XmpSetup_get_temp_path_failed_lasterror
push esi
push edi
call fcn.0040a727
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c98b
mov ecx, eax
call fcn.0040123d
mov ecx, eax
call fcn.0040b202
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x95c]
call fcn.0040cc5a
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.00413d8f
leave
ret