With the SETENV command you can set environment variables from Visual Installer

In this blog post we explained how to use Windows’ environment variables in Visual Installer; for example as a part of a file path. You can also create or change values for environment variables in the system during an installation by using a script command in Visual Installer’s scripting language. The name of the command is SETENV and you can use this command to set an environment variable to a specific value. If the environment variable does not exists, it will be created. If it already exists, its value will be updated.

Examples of usage
The example below shows how to use the SETENV command to set an environment variable with the variable name MyVariable to the value MyValue:

// Example 1: Set MyVariable = MyValue
SETENV MyVariable, MyValue

You can also use Visual Installer’s variables (for example %DESTDIR) when you set values. The example below shows how to set an environment variable with the variable name MyAppsFolder to the path %DESTDIR\MyApps:

// Example 2: Set MyAppsFolder = %DESTDIR\MyApps
SETENV MyAppsFolder, %DESTDIR\MyApps

The picture below shows same examples in Visual Installer’s scripting editor:

SamLogic’s Newsletter Issues in 2015

We have an international newsletter that is targeted for our international customers where we publish information and news related to our products and our company. We send the newsletter about 1-2 times / month. In the newsletter you can read about:

  • Information about SamLogic Software´s products
  • Tips and tricks for SamLogic Software´s programs
  • Technical and non-technical articles
  • Videos (tip videos and information videos etc.)
  • Special offers

Below you can view all newsletter issues that we sent during 2015:

> 13/2015 – Most read articles, read blog posts and viewed videos
> 12/2015 – How to code sign a setup package in Visual Installer
> 11/2015 – How to build a setup package or menu interface silently using a batch file
> 10/2015 – How to create a menu interface in any language in the world
> 09/2015 – A new wizard in CD-Menu Creator makes it easy to create multiple menu pages
> 08/2015 – New 2015 versions of our products – All adapted to Windows 10
> 07/2015 – CD-Menu Creator 2015 is coming soon
> 06/2015 – Visual Installer 2015 is coming soon
> 05/2015 – How to remotely control a Windows application from a tablet
> 04/2015 – Special issue about 64 bit installations
> 03/2015 – How to create a menu interface with 3 columns with buttons
> 02/2015 – New update of Visual Installer 2014
> 01/2015 – Most read articles, read blog posts and viewed videos

Subscribe to our newsletter
If you want to subscribe to our newsletter you can visit the web page below:
> Subscribe to SamLogic Software’s newsletter

Easier to register a type library for a .NET assembly (in Visual Installer)

In the previous version of Visual Installer we added a function that makes it possible to register a .NET assembly. In Visual Installer 2015 (version 10.5.5 and newer) we have extended this functionality so you also can create and register a type library for the .NET assembly.

We have added a new /tlb option to the Register .NET Assembly dialog box. You can see the new option to the right in the Parameters frame in the screen dump below:

If you select this option, a type library will be created in the same folder as the .NET assembly. The type library will have the same filename as the assembly (the .DLL file), but with a .TLB filename extension. For example, if the filename of the DLL is MyFile.DLL, the filename of the type library will be MyFile.TLB.

The type library will be automatically registered after creation.

See also
> Tip: How to register a .NET assembly

How to count the number of shortcuts and tiles in the Start menu in Windows 10

As mentioned in this blog post, the Start menu in Windows 10 has a limit of number of shortcuts and tiles that can be added to the menu. In the first release of Windows 10 the limit was 512 items. But in the latest update of Windows 10 (the “Threshold 2″ update) the limit has been increased to 2048 items.

If you use Visual Installer to install files and encounter problems with shortcuts that are not visible in the Start menu, a good first step is to count the number of shortcuts and tiles in the Start menu. This can be done by using Windows PowerShell and running the Get-StartApps | measure command there:

Get-StartApps | measure

Windows Powershell will then display the number of items in the Start menu in the PowerShell window. For example:

Count

If the build number of your Windows 10 is less than 10547 and the count is above 512 you have added / installed too many shortcuts and tiles to the Start menu. If you have a build number that is 10547 or above and the count is above 2048, you have added / installed too many shortcuts and tiles to the Start menu. In the latter case you need to remove some items before you can add new. In the first case you need to update your Windows 10 to the latest version of the operating system.

(To open Windows PowerShell you can enter “powershell” in Windows search box and press Enter; then Windows PowerShell is started. To see the build number you can enter “winver” in the same search box and choose the winver command in the list that is shown.)

The limit of 512 shortcuts in the Start menu is gone in the latest Windows 10 update

As you probably know, the Start menu is back in Windows 10. But there has been a limit in the Start menu that sometimes have affected installations made by Visual Installer (and other setup tools). The Start menu could only contain up to 512 shortcuts and tiles. And you don’t need to install so many applications before you reach the 512 limit. Many applications can have sub levels with lots of shortcuts, so you can reach the limit faster than you may expect.

When the Start menu reach the 512 limit, no more shortcuts will be added to the menu. The shortcuts will be created in the hard disk in the correct place (by the setup program) but they are not shown in the Start menu.

But Microsoft has now fixed this problem
Microsoft has increased the limit from 512 to 2048 in the latest official update of Windows 10 (the “Threshold 2” update). The distribution of the update will start this week, and soon all Windows 10 users will be able to have up to 2048 shortcuts and tiles in the Start menu.

If you participate in the Windows Insider Program, you may already have downloaded and installed a version of Windows 10 that handles up to 2048 items in the start menu. The problem with shortcuts and tiles were fixed in build 10547 that was released in September. But with the beginning of this week, all users will have access to an update that fixes this problem.

More information
If you want to read more about the 512 limit, you can read the following article on the web:
> Microsoft starts to fix Start Menu in new Windows 10 preview

If you want to know how to count the number of items in the Start menu you can read this blog post on our blog:
> How to count the number of shortcuts and tiles in the Start menu in Windows 10

Using environment variables in Visual Installer

It is possible to use Windows environment variables in Visual Installer. The environment variables can be used in the Registry tab and in the INI files tab in Visual Installer. You can find a list of supported environment variables in this Wikipedia page (see the Windows section).

You use an environment variable in the same way as a Visual Installer variable. For example, to include the %ProgramFiles% environment variable in a file path you can include it like this:

%ProgramFiles%\SamLogic\Visual Installer

And during the installation the %ProgramFiles% variable will be replaced with the current value that the system returns (usually C:\Program Files (x86)).

The picture below shows how to use the %COMPUTERNAME% environment variable in the Registry tab in Visual Installer:

During the installation the %COMPUTERNAME% variable will be replaced with the current computer name of the computer.

See also
> With the SETENV command you can set environment variables from Visual Installer

How to add more files from a previously used folder (Visual Installer)

I guess that you sometimes are in the situation that you need to add more files from the same source folder as some of the files that already are included in your project. But to get there you need to browse through many folders on your hard disk which may take some time.

To simplify and speed up this process we have added a new menu item to the local (right-click) menu in the File list tab in Visual Installer. The name of menu item is Add more files from same source folder and the picture below shows where in the menu to find the new choice.

If you right-click on a file in Visual Installer’s file list and thereafter choose the Add more files from same source folder menu item, the Add files dialog box in Visual Installer will be opened with the files in the same source folder as the selected file listed.

For example, if you right-click on a file in Visual Installer’s file list which source folder is C:\My Pictures\My Second Project, this folder will automatically be chosen and the files in this folder will be automatically listed in the Add files dialog box (see the picture below). And you can easily add more files from the same folder to the file list.

See also
> How to view source paths in the file list in Visual Installer

How to insert a line feed in a setup dialog box (Visual Installer)

There are many built-in setup dialog boxes in Visual Installer that allows you to create a professional setup wizard in just minutes. In some of the setup dialog boxes you can enter many lines with information text, and to make the text easier to read it can be wise to include line feeds and empty lines in some part of the text.

To include a line feed in a dialog box text that you write you need to press Shift + Enter on your keyboard. A line feed will then be inserted at the cursor’s position. To include a blank line you can press Shift + Enter twice. The screen dump below shows how the text looks like with a blank line between the first sentence and the second sentence:

The screen dump below shows the same text in the setup wizard:

Related information
> Setup dialog boxes: How to choose, add text & change image
> Tip: How to add a link to a setup dialog box

How do I code sign a setup package in Visual Installer?

Today it is important to have a setup package code signed before distribution. This is for many reasons:

– You will avoid deterrent warning messages in Windows.
– You will avoid that your installation can not be started in some systems.
– You can be sure that nobody has manipulated your setup package since creation.
– You will protect your setup package against viruses and malware.

How to code sign in Visual Installer
In Visual Installer it is easy to code sign a setup package. In the following tip we explain step by step how to code sign an installation:
> Tip: How to code sign a setup package

Articles about code signing
If you want to read more about code signing we recommend you to read the following articles on our website:
> What is Code Signing / Digital Signature / Digital Certificate?
> Extended Validation (EV) Code Signing

Visual Installer can now import Visual Studio solution files

We have improved Visual Installer’s ability to co-operate with Microsoft Visual Studio. Since many years Visual Installer has been able to import Visual Studio / Visual Basic project files (.vbproj), but starting with Visual Installer 2015 also solution files (.sln) can be imported.

This is very useful if you have a solution that contains many projects. If you choose to import a solution file, Visual Installer will analyze all projects in the solution and import the necessary files.

How to import a Visual Studio solution file
If you want to import a Visual Studio solution file to Visual Installer you can choose the Import Visual Basic project — Visual Basic .NET 2005-2015 project menu item in the File menu in Visual Installer’s editor:

Thereafter you click on the Select project file button in the dialog box that is shown:

As default, project files (.vbproj files) are filtered out in the Open dialog box that is shown, but to the right in the Open dialog box you can choose solution files (.sln files) instead:

Now you can choose a Visual Studio solution file to import.

See also
We have published a step-by-step tip on our website that shows in detail how to import a Visual Basic project or solution to Visual Installer. There is also a tip video available.

> Tip: How to create an installation for a VB.NET application