Page 1 of 1

Problem with .NET 3.5 SP1 as Pre-Req on Win Server 2008 R2

Posted: Tue Mar 08, 2011 5:31 am
by ohali
I've created a setup that includes .NET-Framework 3.5 SP1 as a Pre-Requisite. If I test this setup on a clean Windows Server 2008 R2 (x64), the installation of the Framework fails and I get the message: "Setup has determined that this version of .NET-Framework is part of your operating system ans cannot be installed or uninstalled with this setup. Use Windows Update for all future updates to .NET-Framework. Setup will now exit.". After that I get the standard Messagebox from the setupnet35sp1_x64-Script ("Microsoft .NET Framework 3.5 Service Pack 1 (x64) could not be installed.") and my setup exits.

I've had a look at the server and found out, that the .NET-Framework 3.51 is a "Feature" of the server which is initially not installed. So the script for checking the presence of .NET 3.51 works correct, because it is not installed when I start my setup. However - the setupnet35sp1_x64 script should not fail but rather activate this Feature of the server.

I've noticed that after my setup has exited with this error the "Feature" .NET-Framework 3.51 is installed (see Server-Manager). It should be possible to install the Framework using the command "ServerManagerCmd.exe -install NET-Framework".

Is there an updated setup-script available that will install .NET-Framework 3.5 SP1 on all operating systems including Windows Server 2008 R2? Or should I write my own?

Re: Problem with .NET 3.5 SP1 as Pre-Req on Win Server 2008

Posted: Tue Mar 08, 2011 5:46 am
by giaviv
Dear ohali,

There is no updated setup script available, however I am more than happy to collaborate with you and create one!

Re: Problem with .NET 3.5 SP1 as Pre-Req on Win Server 2008

Posted: Tue Mar 08, 2011 10:00 am
by ohali
Hello,
glad to hear that. I've just found out that after installing the .NET-Framework 3.0 (setupnet30_x64) the Server-Feature ".NET-Framework 3.51" is installed! So it might be necessary to check for the existence of DOTNET30SP2 and DOTNET35SP1 again after installing DOTNET30, at least when the setup is running on a Windows Server 2008 R2. Otherwise setupnet30sp2_x64 will fail with return message -2145124329 which means "SUS_E_NOT_APPLICABLE" (install is not needed because no updates are applicable), which is not really an error and can be ignored safely. If we don't check again for the existence of DOTNET30SP2 we have to ignore this error und continue.

The modified script for setupnet35sp1_x64 could be something like this:

Code: Select all

if Variable DOTNET351_X64 Equals FALSE
 Set Variable PROGRESSTEXT to Installing Microsoft .NET Framework 3.5 Service Pack 1 (x64)
 Set Variable DOTNET351_FILEBAG_X64 to 
 Set Variable DOTNET351_RESULT_X64 to 
 Set Variable DOTNET351_ERROR_X64 to 
 Get System Setting Windows 7 into WIN7
 Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
 if Variable WIN7 Equals TRUE
   Get System Setting Windows with Server Features into WINSERVER
   if Variable WINSERVER Equals TRUE
     Run Program ServerManagerCmd.exe -install NET-Framework (WAIT, get result into variable DOTNET351_RESULT_X64)
     Set Variable PROGRESSMODE to 
     if Variable DOTNET351_RESULT_X64 Equals 3010
       MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
       if Variable REBOOTNOW Equals OK
         Reboot Computer and Resume Setup
         else
         Terminate Installation
       end
     end
     if Variable DOTNET351_RESULT_X64 not Equals 0
       if Variable DOTNET351_RESULT_X64 not Equals 1003
         MessageBox: $TITLE$ Setup, Microsoft .NET Framework 3.5 Service Pack 1 (x64) could not be installed. $DOTNET351_ERROR_X64$$NEWLINE$$NEWLINE$Please use Windows Update to manually install this update on your system.$NEWLINE$$NEWLINE$If there is an error installing the Pre-Requisites Setup should be terminated in most cases.$NEWLINE$$NEWLINE$Should Setup exit now?
         if Variable DOTNET351_X64 Equals YES
           Terminate Installation
         end
       end
     end
     Set Variable DOTNET351_X64 to TRUE
   end
 end
 if Variable DOTNET351_X64 Equals FALSE
   Get Common Folder Location Special->Boot Path into DOTNET351_BOOTPATH_X64
   Define File Bag : #IADIR#\runtimes\net35sp1bin_x64\*.*, include files recursively, get runtime location of files into variable DOTNET351_FILEBAG_X64
   Extract 7Zip Archive $DOTNET351_FILEBAG_X64$\net35sp1bin_x64.7zip into folder $DOTNET351_BOOTPATH_X64$ (get result into variable DOTNET351_EXTRACT_X64)
   if Variable DOTNET351_EXTRACT_X64 not Equals SUCCESS
     MessageBox: $TITLE$ Setup, Unable to extract temporary files for Microsoft .NET Framework 3.5 Service Pack 1 (x64) installation. $DOTNET351_EXTRACT_X64$$NEWLINE$$NEWLINE$Please free up some space on your boot drive and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
     Terminate Installation
   end
   Install/Remove MSI Package $DOTNET351_BOOTPATH_X64$\net35sp1bin_x64\vs_setup.msi[VSEXTUI=1] (get result into variable DOTNET351_RESULT_X64)
   Recursively Delete Files $DOTNET351_BOOTPATH_X64$\net35sp1bin_x64\*.*
   Call DLL Function kernel32.dll->RemoveDirectoryA
   if Variable DOTNET351_RESULT_X64 Equals REBOOT
     MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
     if Variable REBOOTNOW Equals OK
       Reboot Computer and Resume Setup
       else
       Terminate Installation
     end
   end
   if Variable DOTNET351_RESULT_X64 Equals ERROR
     MessageBox: $TITLE$ Setup, Microsoft .NET Framework 3.5 Service Pack 1 (x64) could not be installed. $DOTNET351_ERROR_X64$$NEWLINE$$NEWLINE$Please use Windows Update to manually install this update on your system.$NEWLINE$$NEWLINE$If there is an error installing the Pre-Requisites Setup should be terminated in most cases.$NEWLINE$$NEWLINE$Should Setup exit now?
     if Variable DOTNET351_X64 Equals YES
       Terminate Installation
     end
   end
 end
 Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
end