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

Disassembly:
push 0x954
mov eax, 0x42bd07
call fcn.00413f0e
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.0040ca7d
mov edi, eax
add esp, 0xc
mov eax, 0x432470
cmp edi, esi
jne 0x40f7c9
mov edi, eax
push esi
push esi
push esi
push esi
push eax
push 0x432440
push edi
lea ecx, [ebp - 0x960]
call fcn.0040ba81
mov dword [ebp - 4], esi
cmp edi, esi
jne 0x40f7e8
push ebp
pop ebp
cmp ebx, esi
je 0x40fb7d
xor eax, eax
mov edi, 0x206
push edi
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x216]
push esi
push eax
call fcn.00415aa0
xor eax, eax
push edi
mov word [ebp - 0x830], ax
lea eax, [ebp - 0x82e]
push esi
push eax
call fcn.00415aa0
xor eax, eax
push edi
mov word [ebp - 0x628], ax
lea eax, [ebp - 0x626]
push esi
push eax
call fcn.00415aa0
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 0x40fb41
push edi
lea eax, [ebp - 0x830]
push eax
push dword [0x43ce40]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jbe 0x40fb41
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 0x40fb41
push edi
lea eax, [ebp - 0x830]
push eax
lea eax, [ebp - 0x628]
push eax
call fcn.00415d81
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.0040e7cb
push 0xfe
lea eax, [ebp - 0x92e]
push esi
push eax
call fcn.00415aa0
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 0x40f9d6
xor ecx, ecx
push 2
inc eax
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0041168c
pop ecx
mov dword [ebp - 0x938], eax
cmp eax, esi
je 0x40f9d6
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 0x40f9ca
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 0x40f9ca
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.004135b8
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 0x40fa5c
lea eax, [ebp - 0x218]
push eax
push esi
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
test eax, eax
je 0x40fa5c
mov edi, 0x432414
push edi
call fcn.004069f6
pop ecx
test eax, eax
jne 0x40fb7d
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.0040cf68
mov ecx, eax
call fcn.004014c7
jmp 0x40fb68
xor eax, eax
push 0x206
mov word [ebp - 0x420], ax
lea eax, [ebp - 0x41e]
push esi
push eax
call fcn.00415aa0
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x420]
push eax
call fcn.00416859
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.0040d5c1
add esp, 0x10
test eax, eax
jne 0x40fae6
mov edi, 0x432414
push edi
call fcn.004069f6
pop ecx
test eax, eax
jne 0x40fb7d
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.0040cf68
jmp 0x40fb76
lea eax, [ebp - 0x218]
push eax
push dword [ebp - 0x940]
call fcn.00416859
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.0040ef8b
pop ecx
pop ecx
mov esi, eax
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x960]
call fcn.0040d20c
mov eax, esi
jmp 0x40fb8e
mov edi, 0x432414
push edi
call fcn.004069f6
pop ecx
test eax, eax
jne 0x40fb7d
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.0040cf68
mov ecx, eax
call fcn.004013c8
mov ecx, eax
call fcn.0040ba50
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x960]
call fcn.0040d20c
xor eax, eax
call fcn.00413f91
ret