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

Disassembly:
push 0x954
mov eax, 0x42bd17
call fcn.00413f1e
mov ebx, dword [ebp + 8]
xor esi, esi
mov dword [ebp - 0x940], 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.0040ca8c
mov edi, eax
add esp, 0xc
mov eax, 0x432478
cmp edi, esi
jne 0x40f7d8
mov edi, eax
push esi
push esi
push esi
push esi
push eax
push 0x432448
push edi
lea ecx, [ebp - 0x960]
call fcn.0040ba90
mov dword [ebp - 4], esi
cmp edi, esi
jne 0x40f7f7
push ebp
pop ebp
cmp ebx, esi
je 0x40fb8c
xor eax, eax
mov edi, 0x206
push edi
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x216]
push esi
push eax
call fcn.00415ab0
xor eax, eax
push edi
mov word [ebp - 0x830], ax
lea eax, [ebp - 0x82e]
push esi
push eax
call fcn.00415ab0
xor eax, eax
push edi
mov word [ebp - 0x628], ax
lea eax, [ebp - 0x626]
push esi
push eax
call fcn.00415ab0
add esp, 0x24
lea eax, [ebp - 0x218]
push eax
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jbe 0x40fb50
push edi
lea eax, [ebp - 0x830]
push eax
push dword [0x43ce40]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jbe 0x40fb50
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
lea eax, [ebp - 0x830]
push eax
call ebx
mov dword [ebp - 0x938], eax
cmp eax, esi
je 0x40fb50
push edi
lea eax, [ebp - 0x830]
push eax
lea eax, [ebp - 0x628]
push eax
call fcn.00415d91
add esp, 0xc
push dword [ebp - 0x938]
call dword [sym.imp.SHLWAPI.dll_PathRemoveExtensionW]
lea eax, [ebp - 0x628]
push eax
call ebx
push dword [ebp - 0x938]
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call edi
mov ebx, dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp - 0x218]
push eax
call ebx
lea eax, [ebp - 0x218]
push eax
call fcn.0040e7da
push 0xfe
lea eax, [ebp - 0x92e]
push esi
push eax
call fcn.00415ab0
xor eax, eax
mov word [ebp - 0x930], ax
add esp, 0x10
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x628]
push eax
mov dword [ebp - 0x944], esi
call sub.VERSION.dll_GetFileVersionInfoSizeW
mov dword [ebp - 0x93c], eax
cmp eax, esi
jbe 0x40f9e5
xor ecx, ecx
push 2
inc eax
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0041169a
pop ecx
mov dword [ebp - 0x938], eax
cmp eax, esi
je 0x40f9e5
push eax
push dword [ebp - 0x93c]
lea eax, [ebp - 0x628]
push dword [ebp - 0x944]
push eax
call sub.VERSION.dll_GetFileVersionInfoW
test eax, eax
je 0x40f9d9
lea eax, [ebp - 0x93c]
push eax
lea eax, [ebp - 0x948]
push eax
push 0x42d900
push dword [ebp - 0x938]
mov dword [ebp - 0x93c], esi
call sub.VERSION.dll_VerQueryValueW
test eax, eax
je 0x40f9d9
mov eax, dword [ebp - 0x948]
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 - 0x938]
call fcn.004135c6
pop ecx
lea eax, [ebp - 0x930]
push eax
lea eax, [ebp - 0x218]
push eax
call edi
lea eax, [ebp - 0x218]
push eax
call ebx
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40fa6b
lea eax, [ebp - 0x218]
push eax
push esi
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
test eax, eax
je 0x40fa6b
mov edi, 0x43241c
push edi
call fcn.004069f6
pop ecx
test eax, eax
jne 0x40fb8c
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.0040afdf
pop ecx
pop ecx
mov ecx, eax
call fcn.0040cf77
mov ecx, eax
call fcn.004014c7
jmp 0x40fb77
xor eax, eax
push 0x206
mov word [ebp - 0x420], ax
lea eax, [ebp - 0x41e]
push esi
push eax
call fcn.00415ab0
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x420]
push eax
call fcn.00416869
add esp, 0x14
push str..SetupUI.cab
lea eax, [ebp - 0x420]
push eax
call edi
push esi
lea eax, [ebp - 0x420]
push eax
push str.SETUPUI
push 0x68
call fcn.0040d5d0
add esp, 0x10
test eax, eax
jne 0x40faf5
mov edi, 0x43241c
push edi
call fcn.004069f6
pop ecx
test eax, eax
jne 0x40fb8c
push 1
push str._XmpSetup_save_ui_cab_failed
push esi
push edi
call fcn.0040afdf
pop ecx
pop ecx
mov ecx, eax
call fcn.0040cf77
jmp 0x40fb85
lea eax, [ebp - 0x218]
push eax
push dword [ebp - 0x940]
call fcn.00416869
pop ecx
pop ecx
push dword [ebp - 0x940]
call dword [sym.imp.SHLWAPI.dll_PathRemoveBackslashW]
push dword [ebp - 0x940]
push str.installworkdir
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x420]
push eax
call fcn.0040ef9a
pop ecx
pop ecx
mov esi, eax
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x960]
call fcn.0040d21b
mov eax, esi
jmp 0x40fb9d
mov edi, 0x43241c
push edi
call fcn.004069f6
pop ecx
test eax, eax
jne 0x40fb8c
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.0040afdf
pop ecx
pop ecx
mov ecx, eax
call fcn.0040cf77
mov ecx, eax
call fcn.004013c8
mov ecx, eax
call fcn.0040ba5f
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x960]
call fcn.0040d21b
xor eax, eax
call fcn.00413fa1
ret