1

I want to use AppVeyor to build an application for Windows. The compiler is GNAT GPL 2016 (Ada) for Windows x86.

I get the following message:

Program 'gnat-gpl-2016-x86-windows-bin.exe' failed to run: The specified executable is not a valid application for this OS platform.

Questions:

  • Does Windows Server 2012 R2 Datacenter not support 32-bit applications?
  • Is Wow64 missing?
  • What does DataExecutionPrevention_32BitApplications : True mean?

Get-CimInstance Win32_OperatingSystem | FL * prints out (shortened):

Status                                    : OK
Name                                      : Microsoft Windows Server 2012 R2 Datacenter|C:\windows|\Device\Harddisk0\Partition5
Caption                                   : Microsoft Windows Server 2012 R2 Datacenter
InstallDate                               : 3/9/2016 2:16:51 AM
CreationClassName                         : Win32_OperatingSystem
CSCreationClassName                       : Win32_ComputerSystem
CSName                                    : APPVYR-WIN
LastBootUpTime                            : 10/21/2016 1:10:27 AM
LocalDateTime                             : 10/21/2016 1:11:59 AM
OSType                                    : 18
Version                                   : 6.3.9600
BootDevice                                : \Device\HarddiskVolume3
BuildNumber                               : 9600
BuildType                                 : Multiprocessor Free
DataExecutionPrevention_32BitApplications : True
DataExecutionPrevention_Available         : True
DataExecutionPrevention_Drivers           : True
DataExecutionPrevention_SupportPolicy     : 3
Debug                                     : False
EncryptionLevel                           : 256
OSArchitecture                            : 64-bit
OSLanguage                                : 1033
OSProductSuite                            : 400
RegisteredUser                            : Windows User
SystemDevice                              : \Device\HarddiskVolume5
SystemDirectory                           : C:\windows\system32
SystemDrive                               : C:
WindowsDirectory                          : C:\windows

This question was moved from StackOverflow to ServerFault.
Has Windows Server 2012 R2 Datacenter (64-bit) no 32-bit support?

Edit:

It looks like DataExecutionPrevention_32BitApplications is hindering me to run the installer. How can I run the installer in 32-bit compatibility mode from PowerShell? I have no GUI to select such an option.

Paebbels
  • 135
  • 2
  • 9

2 Answers2

2

Server 2012 R2 is not available in a 32bit version of the OS (for all versions) but they are able to run 32bit applications as with all other 64bit Windows OS's and WOW64 is present, so I do not think that is the problem. That is unless you are one of the few people running on an Itanium processor?

DataExecutionPrevention_32BitApplications : True means that Data Execution Prevent is enabled for 32bit applications. DEP is a process built into the OS that conducts checks on memory to help prevent malicious code from running. DEP has been know to cause issues with older applications so you do have the option to disable it either for everything but critical systems, or for specific applications.

Sam Cogan
  • 38,158
  • 6
  • 77
  • 113
  • And how can I disable DEP, without a) a GUI and b) modifying boot.ini, because it's a VM based build environment. I would like to see a PowerShell command to disable DEP for some files. – Paebbels Oct 21 '16 at 16:55
  • You can turn of DEP from Powershell with BCEdit - https://4sysops.com/archives/how-to-turn-off-data-execution-prevention-dep/ – Sam Cogan Oct 21 '16 at 19:39
  • Have you read my comment? It's a virtual machine. Editing `boot.ini` - that's what BCDEdit does - has no effect on VMs in a cloud... – Paebbels Oct 23 '16 at 16:21
  • I read your comment just fine thanks and your incorrect there. Turning of DEP through the GUI is exactly the same process as running the PowerShell command, and it works just fine. – Sam Cogan Oct 23 '16 at 16:24
  • But it's only activated after a reboot. I get a new fresh VM for each build task. So such a configuration has no effect. – Paebbels Oct 23 '16 at 18:35
  • Well I would suggest looking at this as two different problems. First get a static machine up, disable DEP and see if it resolves the error, there's no point spending time on it if it doesn't fix it. If it does then you will need to look at either creating a custom image to use for creating your VM or using something like Powershell Desired State Configuration to configure the VM With DEP disabled when it is created. – Sam Cogan Oct 23 '16 at 18:39
1

Windows Server 2012 R2 support x86's model application, but on the other hand needed dependancy for your .exe are surelly not installed. (like vcruntime x86, etc..)

I seen your comment on the other thread that the .exe is called from powershell, please use the x86's powershell's console for such's task.

%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe

yagmoth555
  • 16,300
  • 4
  • 26
  • 48
  • Can I start the x86-32 PowerShell from within the x86-64 PowerShell? The build system starts my script via a yaml file option: `before_build: ps: install.GNAT.ps1` I have no influence on the option ps, if it's 32 or 64 bits. – Paebbels Oct 21 '16 at 16:57
  • @Paebbels The 64 bit process is what, the compiler ? I would install the x86's version of it, so it would run the windows with the x86's powershell at the start, else you will need to write it that way; **%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe -file "c:\path\install.GNAT.ps1"** in your batch file – yagmoth555 Oct 21 '16 at 17:42
  • The compiler is 32-bit and it's installer is 32-bit. I could try to install it locally and copy a zip-file to the machine, but I still have to execute the 32-bit compiler. The question is: How can I start the 32-bit PowerShell, when my initial PowerShell is 64-bit? Can I invoke the 32-bit PS from a 64-bit PS? – Paebbels Oct 23 '16 at 16:18
  • check in my comment before, never tried it, but you will have to force the 32b ps, with the -file parameter – yagmoth555 Oct 23 '16 at 19:13