0

I'm trying to package Oracle Forms 10g within Intune to deliver to some users. In order to install this ancient dev app, it must run in WINXPSP3 compat mode. I'm using a batch file to install it, so naturally, I want to add a registry key to prompt setup.exe to run in compat mode.

I add a line in the batch file...

rem SETUP_APPCOMPATFLAG
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\ProgramData\AnF\Oracle10GStaging\disk1\setup.exe" /t REG_SZ /d "WINXPSP3" /f

Before running my exe file...

rem RUN INSTALL
%OF10gfiles%\disk1\setup.exe -responsefile %OF10gfiles%\install_oracle10g.rsp -silent -noconsole -nowelcome -waitforcompletion

Running this batch file locally on a test machine works flawlessly. I have other additions to the registry in this batch file that are added without issue. For whatever reason, these additions cannot be added to this specific area.

It's not like it's added and needs a reboot, it's simply doesn't get added. I don't think it's a syntax issue; I assume it's being denied access to add it here, but I've no clue by what or why.

The Intune package is set to run as SYSTEM, not user. All other functions in the batch file run as expected, but without this compat-mode addition, setup.exe will not run. I've been googling for a day, and others have had this problem but I haven't found anyone who has figured out why.

Any help or suggestions would be greatly appreciated. Thank you all in advance.

MaxKorban
  • 107
  • 1
  • 3
  • 13
  • If you're running that command, and there is an issue, there should be output. Tell us what the output is please. – Compo May 18 '23 at 14:44
  • There is no output from Intune. Intune is an endpoint mgmt solution similar to SCCM. It runs the batch files on its own, so there's no output for me to view. As I said, when it's run locally, it's flawless; no issues whatsoever. If I HAD output from Intune on this batch file, I would be able to see the problem and probably correct it. Lack of visibility with Intune is a problem. – MaxKorban May 18 '23 at 14:59
  • Open a Command Prompt window on the problem machine, type ```%SystemRoot%\System32\reg.exe Add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /V "C:\ProgramData\AnF\Oracle10GStaging\disk1\setup.exe" /D "WINXPSP3" /F```, and press the `[ENTER]` key. Then tell us what happens. I should mention however that any modifications under the `HKEY_LOCAL_MACHINE` root key would need to be 'Run as administrator', i.e. elevated. – Compo May 18 '23 at 15:16
  • It succeeds. Like I said, running it locally is fine. Having Intune run it fails. The question here is WHY is it failing while running from Intune. I have 5 reg adds in my batch file. All succeed running locally myself. All succeed except the 2 of them writing to this particular key when Intune runs the file. So why can't Intune write to this key? Why is it protected? And is it Intune that can't write to it or is something else preventing Intune from writing to it? – MaxKorban May 18 '23 at 16:43
  • What I need is Intune to have verbose logging of batch file output. AFAIK, Intune has no such thing. – MaxKorban May 18 '23 at 16:50
  • There is written "it must run in WINXPSP3 compat mode". I am not sure but I think this cause an execution in 32-bit environment on 64-bit Windows. That means there is executed due to [file system redirector](https://learn.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector) 32-bit `C:\Windows\SysWOW64\reg.exe`. That causes a write to `HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AppCompatFlags` (note `Wow6432Node` in key path) due to [Registry Keys Affected by WOW64](https://learn.microsoft.com/en-us/windows/win32/winprog64/shared-registry-keys). – Mofi May 18 '23 at 17:42
  • I recommend to make sure that on 64-bit Windows is executed always 64-bit `%SystemRoot%\System32\reg.exe` by using `%SystemRoot%\Sysnative\reg.exe` on running currently in 32-bit execution environment on 64-bit Windows and use the appropriate key path or use the appropriate `reg ADD` option on being available at all (depends on version of `reg.exe` depending on Windows version). – Mofi May 18 '23 at 17:44
  • Aaternatively if this is intended for x86 on a x64 system, you could just use the appropriate option: ```%SystemRoot%\System32\reg.exe Add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /V "%ProgramData%\AnF\Oracle10GStaging\disk1\setup.exe" /D "WINXPSP3" /F /Reg:32``` – Compo May 18 '23 at 20:03

0 Answers0