Inno Setup - "An attempt was made to download a program with the wrong format" when trying to install the NetFx3 function

I am working on installing a script with Inno Setup, and I need to install SQL Server 2008 R2 Express, if it is not already installed.

As for installing the .NET Framework 3.5 SP1, I downloaded and tried to install netfx35.exe from my script. But I can’t do the installation directly, I have to do it using the Add Roles and Features Wizard. To do this automatically, I use Dism, but I have an error when I try to enable the NetFx3 function. The following is information about the actions that I performed:

(The script was developed under the 64-bit version of Windows 7 Professional SP1 and runs under Windows Server 2008 R2 Standard 64 bit, on which I am registered as an administrator.)

Step 1 . Verify that the command line is correct.

On a Windows Server computer, I ran the following command line, both on the cmd command line and in the batch file, to make sure that the command I'm trying to execute is correct and is doing the right job.

Dism /online /enable-feature /featurename:NetFx3 /NoRestart

As a result, I expected .Net Framework 3.5 to be included.

Step 2 . Try the same command line from the Inno Setup script.

Exec('Dism', ' /online /enable-feature /featurename:NetFx3 /NoRestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
MsgBox(SysErrorMessage(ResultCode), true, MB_OK);

script, " ". - ( 32- 64 ). , :

Dism.exe /online /enable-feature /featurename:NetFx3 /NoRestart
C:\Windows\System32\Dism.exe /online /enable-feature /featurename:NetFx3 /NoRestart
C:\Windows\SysWOW64\Dism.exe /online /enable-feature /featurename:NetFx3 /NoRestart

Inno Setup, . , , Inno Setup IsAdminLoggedOn True.

- ? , .

.

+3
1

.

DISM , 32- Inno Setup, , 64- .

Setup :

ArchitecturesInstallIn64BitMode=x64

, , .

+1

All Articles