This appears to be somewhat related to the question How to detect what .NET Framework versions and service packs are installed?, so I'm linking to it here for reference.
Essentially, there's no built-in support in iexpress to detect the .NET framework and install it; you have to do this yourself. Theoretically you could write something in batch for this; a simple example could look like:
@echo off
setlocal
rem Check if .NET 4.0 is installed; if not, try to install it
reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full" /v Install
if not errorlevel 0 dotNetFx40_Full_x86_x64.exe /q /norestart
rem Check if the install was successful; if it was, install app
reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full" /v Install
if not errorlevel 0 exit /b 1
::[...install app, etc...]
Bundle a copy of .NET 4.0 (dotNetFx40_Full_x86_x64.exe
) in the IExpress archive, set that batch file as your install command (eg cmd /c install.bat
), and set Long File Name support.