Archive: Compiling Win64 installer on 32bit system


Compiling Win64 installer on 32bit system
I tried compile 64bit installer on a 32bit system in this way:
1. Compiling Exehead's and ui's for AMD64
2. Replacing the binaries in the NSIS directory strcuture with the 64bit version
3. Compiling the script with the 32bit version of makensis

The compilation process was broken at the ChangeUI command.
( I use ModernUI )

Is there any solution for my problem?


Not yet. The resource editor can't edit 64-bit resources. You can try simply replacing the the structure definitions with the 64-bit version. It might work.


I changed the _IMAGE_NT_HEADERS struct to _IMAGE_NT_HEADERS64, but in _IMAGE_NT_HEADERS64 struct's sub element IMAGE_OPTIONAL_HEADER64 no more BaseOfData member.

After commenting out two lines in ResourceEditor.cpp (318 and 319) the compilation finished, but the makensis.exe tried to read the stub from it's own file.


What do you mean by saying makensis.exe is trying to read the stub from its own file? The stub file should have no affect here. It's read into memory before the resource editor gets into action. Or are you no longer talking about the resource editor? What error message does it show?


I don't remember the real message.
The makensis.exe tried to read the "...makensis.exe/zlib" stub.

I tried again the modification with the original source code of 2.15 and I made it. :D

I modified the ResourceEditor.h/.c and the plugin.c.
Both were IMAGE_NT_HEADERS64 dependent.

Compiling the stub-s to amd64 is strange because memset amd memcpy functions are needed. :weird:
Appending memset.c and memcpy.c from the source package to the files list in Sconscript file wasn't a good way for me. I added the libc.lib to the libs.

I cannot compile the system plugin.
There are three naked functions and the compilert don't support inline assembly.

----------------------------------------------
I have the worst english knowledge. Sorry. :D


XPStyle
One more thing:

In the szXPManifest XML string the processorArchitecture property must be Amd64 or Ia64.


Do the generated installers actually work? There are some "unsafe" casts in the code which are a bit too much over to the unsafe side. For example, the blocks loading loop in loadHeaders forces a 64-bit pointer to a 32-bit integer. Those block pointers are then used everywhere in the code.


I haven't solved any cast warning in the code.
It works without any problem at this moment.