CD-Menu Creator 2018 has now been released

A new version of our menu designer tool CD-Menu Creator has now been released. The name of the new version is SamLogic CD-Menu Creator 2018, and some of the new features in the new version are:

• Supports the latest version of Windows 10.
• You can now change font for CD-Menu Creator’s editor.
• Creation date of a menu is automatically saved in the Version tab of the editor.
• All redistributable binary files are now code signed with an EV digital certificate.
• Improved error handling.
• New menu interface examples have been included.

A more detailed list with the new features is available on this page.

How to write-protect a file after installation

Sometimes it is necessary to write-protect a file after it has been installed on a hard drive. If you use Visual Installer to install your files, this is very easy done if you follow these steps:

1. Open your project file or create a new one.
2. In the File list tab, select the file that you want to write-protect.
3. Choose the List – File copy options menu item.
4. Select the Turn on write protection option:

The 'Copy Options' dialog box (1)

5. Click OK.

If you want to be able to update the write-protected file during a future update, you can also select the Replace also write protected file option:

The 'Copy Options' dialog box (2)

Now when you install your files, the file that you selected at step 2 above, will be write-protected after the installation. You can check that this really works as expected by right-clicking on the file in Windows Explorer and thereafter choosing the Properties menu item in the local menu that is shown. In the General tab in the Properties dialog box, the Read-only check box should be checked (as shown in the picture below):

The 'Properties' dialog box

See also
> How to set file copy options in Visual Installer
> The ‘Inst’ column in the ‘File list’ tab in Visual Installer

How to remember installation date

When you install a software it can sometimes be useful to remember the installation date. In Visual Installer you can do it by using the %DATE variable, which retrieves the current date from the system during an installation. The contents of the %DATE variable can then be stored in the Registry or in an INI file.

If you want to store the current date in the Registry during the installation, you can enter a line like this in Visual Installer’s Registry tab:

HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\MySoftware :: InstallationDate=”%DATE

See also the picture below (the screen dump is from the Registry tab):

The 'Registry' tab in Visual Installer

The %DATE variable will be replaced with the current date when your files are installed in the end user’s computer. The picture below shows how it may look like:

The Windows Registry

See also
> Variables in Visual Installer

Visual Installer: Does SETPERM change folder permissions also for sub folders?

With the SETPERM script command in Visual Installer’s script language you can change permissions for a folder on the user’s hard disk during an installation. But what happen with the sub folders? Are the folder permissions inherited?

Yes. They are normally. But if you really want to be sure that all sub folders have the same permission settings as the main folder, you can set the permissions for them separately. For example like this:

SETPERM %DESTDIR\Documents, PERM_ALL
SETPERM %DESTDIR\Documents\Text, PERM_ALL
SETPERM %DESTDIR\Documents\Word, PERM_ALL

With this method you can also give a sub folder another folder permissions than the main folders. For example like:

SETPERM %DESTDIR\Documents, PERM_ALL
SETPERM %DESTDIR\Documents\Pdf, PERM_READ

See also
> How to give a standard user write permission to a folder in Program Files
> Visual Installer’s Scripting Language

SamLogic’s Newsletter Issues in 2017

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 2017:

> 08/2017 – How to add a folder tree to Visual Installer’s file list
> 07/2017 – How to protect a Visual Installer installation with a license key or password
> 06/2017 – How to make an installed program run with administrator rights
> 05/2017 – Summer special – 30 tips for Visual Installer and CD-Menu Creator
> 04/2017 – How to add social media icons to a menu interface
> 03/2017 – The new Visual Installer 2017 is compatible with Visual Studio 2017
> 02/2017 – The new Visual Installer 2017 has now been released
> 01/2017 – The new CD-Menu Creator 2017 has now been released

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

Using the ‘Add tree’ function in Visual Installer

If you already have created a folder structure on your hard drive, with the files that you want to install, and want to create a similar folder structure on the destination drive, there is a very useful function in Visual Installer that you can use. The name of the function is Add tree and you can access it via the List menu in Visual Installer, by choosing the List – Add – Add tree menu item (see the picture below):

The 'Add tree' menu option

After you have chosen this menu item, the following dialog box is shown:

The 'Select folder' dialog box (1)

Via this dialog box you can browse to the folder, with sub folders and files, that you want to add to Visual Installer’s file list. For example like:

The 'Select folder' dialog box (2)

You can see the current folder path to the right of the Folder field name in the dialog box.

After you have selected your folder, you can click on the OK button to continue. The following dialog box will now be shown:

Collect files from folders and sub folders

In the option frame (above the three buttons) you can choose how the folder structure will be built in Visual Installer’s file list. You can choose between replacing the root level of the folder tree with the %DESTDIR variable, or add the folder tree to the %DESTDIR variable.

When you have decided how you want to build the folder tree, you can press the Add files button. Now Visual Installer’s file list will be filled with the files and folders. And you can see how many files that were collected in the No. files field name in the dialog box:

Ready!

To return to the file list, just press Close in the dialog box.

The collected files

How to obtain only folders of a folder tree
Instead of collecting the files in a folder tree you can also extract only the folders (directories) of the tree and skip all files. In this blog post we explain how to do this.

How to add a folder tree to Visual Installer’s file list

With the Add tree function in Visual Installer you can add a folder structure including files to Visual Installer’s file list in an easy way. It is also possible to add a folder structure without files to Visual Installer’s file list with the same Add tree function. We will show below how to do this.

1. Open the List menu and choose the Add – Add tree menu item.

The 'Add tree' menu option

2. Select a folder in the Select folder dialog box and click OK.

The 'Select folder' dialog box

3. Click on the More options button in the Collect files from folders and sub folders dialog box that now appears.

Collect files from folders and sub folders

4. Select the Only add folders option in the More options dialog box that now is shown.

The 'More options' dialog box

5. Click OK to close the dialog box. The text in the previous opened dialog box will be updated to:

Collect folders from folders and sub folders

6. Now click on the Add folders button to start collecting folder. All folders and sub folders in the selected folder (in step 2) will be added to Visual Installer’s file list. The number of collected folders will be displayed after the No. files field name in the dialog box.

Ready!

7. Click the Close button in the dialog box to return to the file list.

The collected folders

How to check if Microsoft Office is installed during an installation

We have added new conditions to Visual Installer’s script language that can be used to:

• check whether Microsoft Office is installed in the computer or not
• check if the installed Microsoft Office is 32 bit or 64 bit

This can be useful if you for example:

• install files that require that Microsoft Office is installed in the computer
• install files that require a specific bitness of Microsoft Office (for example 32 bit Office)
• want to install different files depending on the bitness of Microsoft Office

You can read more in this blog post:

> How to check if Microsoft Office is installed during an installation

Using the log function in Visual Installer’s script language

When using the script language in Visual Installer, it may sometimes be useful to see in detail what happen when the script lines are executed. To get detailed information about the execution of script commands, you can activate a log function in Visual Installer’s script language. When the log is activated, detailed information about every script line that is executed are stored in a log file. Here you can see the contents of the parameters that are passed to the script commands and see the return value (for example error codes) of every command. If you use variables in the script (for example %DESTDIR) you can see their actual values.

How to activate the log function
To activate the log function, you can use the USELOG script command. To enable the log, enter the following in the beginning of your script code:

USELOG 1

As default, the log file is stored in the main destination folder of the installation (the folder path that is stored in the %DESTDIR variable) but you can also specify your own folder for the log file via parameter 2. For example:

USELOG 1, C:\MyLogFolder

To turn off the log, somewhere in the script, you can enter the following:

USELOG 0

If you want to log all lines in the script, you don’t need to turn off the log at the end. It will be turned off automatically after the last executed script line.

In the picture below, you can see an example of how the USELOG command can be used:

USELOG

And below is an example of how the log file may look like:

Log (OK)

If a script command succeeds, it returns OK. Otherwise it returns ERROR and an error code. Below is an example of how the log file may look like if an error occurs:

Log (Error)

Most error codes can be found on this web page at Microsoft’s web site:

> Windows Dev Center: System Error Codes (0-499)

Some common error codes are:

2 : File not found!
3 : Path not found!
5 : Access denied!
183 : File already exists!

Filenames
The filename of the log file is Vinstall-Script–Before.log if the script lines are executed in the Before installation tab in the Execute script commands window in Visual Installer, and the filename is Vinstall-Script–After.log if the script lines are executed in the After installation tab in the same window. The filenames can not be changed, but you can change the folder where the log files are stored (as described above).

See also
> Visual Installer’s Scripting Language

Two useful tips about Visual Installer and .NET Framework

Do you use SamLogic Visual Installer to create installation packages for your .NET applications and .NET components? If yes, then you should check the following two tips that we have published on the tips section for Visual Installer:

Tip 1
Explains how to handle situations when the required version of .NET Framework is not installed in the end-users computer:
> How to prevent an installation if wrong .NET version

Tip 2
Explains how to register a .NET assembly, and when it is needed:
> How to register a .NET assembly

More tips
More tips for Visual Installer are available here:
> Tips & tricks for SamLogic Visual Installer