PDA

View Full Version : install 46-bit files


omaravet
09-04-2006, 07:24 AM
i need to install my program on windows xp 64-bit
some files must be installed in system32 directory
all file redirected to to syswow64
the script like this

if System.Is64BitOS then
DLL.CallFunction(_WindowsFolder.."\\SysWOW64\\kernel32.dll", "Wow64DisableWow64FsRedirection", "\""..Application.GetWndHandle().."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
File.Move(_SystemFolder.."\\SysWOW64\\myexe.exe",_SystemFolder.."\\system32");
File.Move(_SystemFolder.."\\SysWOW64\\mydll64.dll",_SystemFolder.."\\system32");
result = File.Run(SessionVar.Expand("%WindowsFolder%\\System32\\myexe64.exe"), "", SessionVar.Expand("WindowsFolder%\\system32"), SW_MINIMIZE, true);
end
the file not moved to system32 directory and i try to run my 64 bit exe in folder syswow64 to copy files from setup script not work also

Eagle
09-04-2006, 12:06 PM
Hi there:

Before you call the disable FS redirection:

_SystemFolder IS this: the full path to the SysWOW64 folder on system.

After the FS disable redirection call:

_SystemFolder IS this: the full path to the 'real' system32 folder.

So below code should be valid:


if System.Is64BitOS then
DLL.CallFunction(_WindowsFolder.."\\SysWOW64\\kernel32.dll", "Wow64DisableWow64FsRedirection", "\""..Application.GetWndHandle().."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
File.Move(_WindowsFolder.."\\SysWOW64\\myexe64.exe", _ SystemFolder.."\\", false, true, true, true, nil);
File.Move(_WindowsFolder.."\\SysWOW64\\mydll64.dll", _ SystemFolder.."\\", false, true, true, true, nil);
result = File.Run(_SystemFolder.."\\myexe64.exe"), "", _SystemFolder, SW_MINIMIZE, true);
end

OR this:

if System.Is64BitOS then
DLL.CallFunction(_WindowsFolder.."\\SysWOW64\\kernel32.dll", "Wow64DisableWow64FsRedirection", "\""..Application.GetWndHandle().."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
File.Move(_WindowsFolder.."\\SysWOW64\\myexe64.exe", _WindowsFolder.."\\system32\\", false, true, true, true, nil);
File.Move(_WindowsFolder.."\\SysWOW64\\mydll64.dll", _WindowsFolder.."\\system32\\", false, true, true, true, nil);
--test run the moved myexe64.exe and support dll
local nreturncode = File.Run(_WindowsFolder.."\\system32\\myexe64.exe"), "",_WindowsFolder.."\\system32", SW_MINIMIZE, true);
local nerror = Application.GetLastError();
if (nerror ~= 0) then
Dialog.Message("File Run Error Information","myexe64.exe "..nreturncode.."\r\nInternal error: ".._tblErrorMessages[nerror]);
end
end

NOTE: after you test run the 'myexe64.exe' , you should re-enable FS redirection so the Installer will complete properly.

Hope I understand what you are doing ..

hth a little

omaravet
09-05-2006, 05:13 AM
thank you for reply eagle
the paths is so rong and i changed it as you said

but i foud that the condition of System.Is64BitOS not return true on windows xp 64 bit

i take it from help example

b64Bit = System.Is64BitOS(); give me error is nil

and System.Is64BitOS not return true

i correct the script as you said and it work fine but without the condition

Eagle
09-11-2006, 11:47 AM
"but i found that the condition of System.Is64BitOS not return true on windows xp 64 bit"

I have not had any issues with this...lotsa testing with WinXp X64 installed
OS and when running from it. Incase you are running an 'IA64' version of
Windows XP 64bit(no longer supported by MS) then please advise.

As I would like to know if possible, tks