How to ask for a drive instead of a folder during an installation

Normally when a user runs an installation, the installer will ask for a destination folder. A default folder name and folder path is shown, but the user can usually change the folder name and the folder path, and enter his/her own.

But there are situations when the folder name and folder path must stay unchanged, but the user should have the possibility to change the drive letter.

In Visual Installer we have a special setup dialog box that is designed for this purpose. You can include this dialog box in your installation by checking the Drive option in the Dialog boxes tab in the Visual Installer editor.

If you check this option, the following setup dialog box will be shown in the installation:

In this dialog box the end-user can change the drive letter, but not the folder path. The folder path is shown for the end-user, but it is a read-only field. He can not change the path.

The ‘Version’ tab in CD-Menu Creator

The CD-Menu Creator editor contains 8 main tabs, from where the most of the work to create a menu interface is made from. The last (the rightmost) tab is the Version tab.

In this tab you can enter version information for your menu project. For example company name, product name, product description and version number. In this tab you can also see the date when your menu was last created. This text field is updated automatically, so you don’t need to enter any information here.

Some of the text fields in the Version tab can also be used as variables in menu interfaces. That includes the following text fields: Company, Product Name, Product Description, and Version Number. More information about these variables is available in this tip.

How to test an installation before you create it

Before you actually create an installation package on your hard drive or USB stick, with Visual Installer, you can test it. You can step through all setup dialog boxes in your project and simulate an installation of you files. The tip below explains how to do it:

1. Start Visual Installer.
2. Open a current Visual Installer project or create a new one.
3. Open the File menu.
4. Choose Test on the menu.
5. In the dialog box that is opened, click on the Start simulation button.

Now the simulation will start.

The simulation will look like a real installation, but no files are copied and no folders are created. The Registry will also remain untouched. There will be no changes in the computer at all, so you can run it safely to test your installation.

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

How to change source folder paths for a group of files

Sometimes it is necessary to change source folder paths for a group of files in Visual Installer’s file list. This is necessary if for example some files have been moved to another folder location or if you change computer and the folder paths that are used in the new computer are different. But luckily, this is very easy done in Visual Installer. In the tip below we show how to do this.

How to change source folder paths for a group of files

1. Start Visual Installer and open your Visual Installer project file (.VIP file).
2. Open the List – Replace – Replace source folders menu item (see picture below).

List - Replace - Replace source folders

3. Enter the existing folder path and the new folder path in the dialog box that is shown.

Search and replace source folder

4. Click OK in the dialog box to do the replace operation.

Now every folder path that match the criteria will be updated in the file list.

To make sure that folder paths are correct spelled and really exists on the drive, you can hit the F5 button. If the folders do not exists, Visual Installer will show a warning message and show which files in the file list that have wrong folder paths.

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

How to make sure that a shortcut (icon) is created for all Windows accounts

In Visual Installer you can choose whether you want to add shortcuts (icons) for the Windows account that is used to install your files, or for all Windows accounts in the computer.

Mostly the Windows account that is used for installation is the same as the Windows account that is used to run the software or access the files. But this is not always the case. If different Windows accounts are used for installation and for daily use, you might end in a situation where there is no shortcut (icon) to access your software or files.

To prevent that this situation occurs, you can open the Program group / menu dialog box (via the List menu) in Visual Installer, and make sure that the Create program group / menu for all users option is selected in the dialog box. If not, you can select this option.

Program group / Menu

Now your shortcuts (icons) will be accessible for all users (all Windows accounts) in the computer. This affects also desktop shortcuts and other types of shortcuts.

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

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