PDA

View Full Version : Install .net



notlogan
08-20-2013, 12:41 PM
I found this in another thread:

"IMO, it's better to check for .NET 3.5 and if it is not available, open the
standard .NET 3.5 download page from your installer so users can download
and install it."

HOW would I do that?

linder
08-21-2013, 01:40 AM
Hello,

I have created and uploaded a simple demo project for you:

http://www.lindersoft.com/projects/net35web.zip

Please COMPILE and RUN the project.

Does this help?

Friedrich

notlogan
08-21-2013, 06:20 AM
Thanks.

Can I change the %NET35 variable to check for .net 4.5?

linder
08-21-2013, 06:41 AM
Yes, no problem.

Check for $NET_FRAMEWORK_45$ instead of $NET_FRAMEWORK_35$

Friedrich

notlogan
08-21-2013, 07:51 AM
Thanks. That's what I did:

linder
08-21-2013, 08:27 AM
Perfect!

Friedrich

notlogan
08-21-2013, 11:02 AM
Can I do something similar with SQL Server Express?

Our app checks for SQL the first time it is run and requires the installation of SQL if it is not found. Could I make SQL an optional installation? If they missed it during the initial install and got our error banger they could go back to the installation program and install SQL Express? I was going to include SQL Express on the installation medium - probably a jump drive.

On a side note, we would also need to run a script to install a SQL database after SQL server is installed. We are also doing that inside our app right now but it would probably be better handled as part of the setup.

linder
08-22-2013, 01:20 AM
Hello,

Absolutely no problem. But it depends on the SQL Server Express version. Would you like to check for 2012 or a previous version?

BTW, to run a script, just call the sqlcmd.exe tool from your install (e.g. from the "Run Command Line" or "Run Program" functions) and you are done.

http://technet.microsoft.com/en-us/library/ms180944.aspx

Friedrich

notlogan
08-26-2013, 06:32 AM
We don't really care what version of SQL is installed. Can we check for any version? Or do we have to check for specific versions?

Is it possible to install .net from the installation media?

linder
08-26-2013, 06:41 AM
Hello,

It depends on the SQL version (and "bitness"). You have to use the "Get Registry Key Value..." script function to see if the specific SQL version is installed (32- and 64-bit versions).

For example, you have to scan the registry for:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.2005\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.MSSQLSERVER\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.SHAREPOINT\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.SOPHOS\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SHAREPOINT\Setup Edition
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\ Setup Edition
(...and more...)

Friedrich

linder
08-26-2013, 06:44 AM
BTW, and you can check for locally installed SQL Server instances on a system. This information is stored in the registry at the following location:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL

You have to check this for 32-bit and 64-bit! See "Set x64 Mode..." script function to switch into 64-bit mode to check the 64-bit registry branch.

Friedrich

notlogan
08-26-2013, 07:07 AM
Thanks. I'm not sure how to check registry keys...but I suppose I will find out. Right now our app is checking for SQL Server. I'll probably want to make a more tightly integrated installation program for future releases.

But right now I'm back on .net. Our developers don't like having to go to the MS website to download .net. I have dotNetFx45_Full_setup.exe. I tried scripting it as:

If %NET45_STATUS% Equals "0" Then
Display Message Box...
If %_SB_RETURN% Equals "$IDYES$" Then
Run Program %PROGRAMFILESDIR%\dotNetFx45_Full_setup.exe
Else
Exit Installation()
End
End

It tells me .net is not installed but doesn't hit the .net setup.exe program. It continues with the welcome screen. I copied .net exe into the installation program into the Program Files folder.

linder
08-26-2013, 07:19 AM
Hello,

Don't install the redistributable into the "Program Files" folder to launch it. Only install what your own program needs, but never a redistributable.

Please see the "Core PreRequisites" (screenshot). SB8 Developer Edition comes with a ready-to-use .NET4.5 module ;) You can modify the include script if you want or use it as a starting point. No need to reinvent the wheel :)

Friedrich

linder
08-26-2013, 07:30 AM
Just a quick note. To find our what causes a start program issue you can check the %_SB_ERRORCODE% and %_SB_RETURNEX% variable values (see attached).

And always set the "Wait for Program" option if you need a return status. Selecting this option will cause the installer to be suspended until the external program has finished. If this option is not chosen, the script will continue to run while the external program finishes. If the script will use information created or gathered by the external program, this option is required for the script to complete successfully.

Friedrich

notlogan
08-26-2013, 07:47 AM
Is "Core PreRequisits" part of the developer package? I downloaded professional & it's not available.

linder
08-26-2013, 08:00 AM
Yes, it's part of the Developer Edition.

Professional Edition lets you quickly build basic installs. All the advanced features (e.g. x64 support, .NET support, etc.) are part of the high-end Developer Edition flagship product.

http://www.lindersoft.com/products_setupbuilder_dev_features.htm

Friedrich