Browse DevX
Sign up for e-mail newsletters from DevX


Create installations with Visual Studio Installer : Page 3

Visual Studio Installer is a free tool from Microsoft for creating installations for Windows applications. Visual Studio Installer is available in two English versions: version 1.0 works on Windows 98 and version 1.1 works also on Windows ME and 2000/XP. You can download version 1.1 from here. The on-line documentation and MSDN articles show the differences between VSI and the Installation Wizard accompanying Visual Basic. This article is just an overview of the VSI features.




Building the Right Environment to Support AI, Machine Learning and Deep Learning


Customizing the File System item


Managing files is the hardest argument. Open the File System item. In the central window you will see a list of folders. Each folder contains some files, or just some shortcuts.



The Windows System Folder contains DLL libraries or ActiveX components which have to be registered by the installer. This is the right location for other files that must be placed in Windows System directory.

To add one or more Windows special folders (ie: Windows, Application Data etc.) right-click and select Add Special Folder then select the special folder you need.

Executable s, type libraries, text documents, images, and all files needed by your application must reside in the Application Folder. You can also create sub-folders and add new files there, with just a mouse right-click.

Because VSI reads VB project dependencies, you do not need to add components or system files in File System, except for those files that VSI cannot read from the source project (like documents, databases, etc.).

You can add shortcuts in the User’s Start Menu and User’s Desktop folders, with a mouse right-click, just selecting Create Shortcut.

Select the shortcut destination from the file list. You can also specify some more features, first of all the shortcut icon. This necessary since VSI gets icons only for executables, so for other file types you must specify an icon.


In the Description property you can add comments, so that users can see a description when choosing the Property dialog box for an executable.  The vbShowCmd property is similar to the vbNormal, vbMinimized, vbMaximized VB costants, and sets windows size. In the Arguments property you can specify fixed parameters and arguments for your executable.


Creating Windows Start Menu shortcuts


To create folders and shortcuts in the Windows Start Menu, right-click on File System on Target Machine, and select Add Special Folder and then Custom. VSI will create a new sub-folder called NEWFOLDER. Rename this folder in ProgramMenuFolder. Write folder name exactly as shown. This is a Windows Installer constant, used to identify that particular folder. This new folder is the Program Files folder in the Start Menu.

Now, you can add a new sub-folder under ProgramMenuFolder and name it as you like, adding here shortcuts as shown before.




The Tasks List


At the bottom of the screen you can see the Task List. Once completed the above operations, select the Build command from the Build menu. VSI will begin to create the installer. If nothing appears in the task list it means that the package has been created with no errors.

The task list can display simple warnings or critical errors. In the latter case, you will see the Failed message on the status bar.


A very simple but frequent error is to add duplicate filenames in the File System.

Warnings are not often important, anyway you should verify the reason why they were issued. The most frequent warning is about DLL versions. It is possible that your operating system contains DLLs with different version than those used by VSI for creating packages. Since VSI uses its own merge modules containing system and run-time libraries, it will just emit warnings about components with different versions. You can leave things unchanged, since VSI will not overwrite later versions of the same components.


Other warnings can be related to the lack of dependencies for type libraries, dynamic link libraries or ActiveX components. If you have no dependencies file (particularly for your own type libraries), you should control the source code, if possible, and verify that each file required by your component is included in the package.

For example, your application has a reference to a certain type library, but you have no dependecies file for this component; in this case VSI shows a warning message, and you must be sure that all the required libraries are included in the File System, (in this case VSI cannot rely on dependencies), because otherwise the application will not work on machines that don't contain components required by the type library. Here's a sample task list:



Building the Installer Package


You are now ready to build your own package. From the Build menu you have to select the Rebuild command. VSI will create a Windows Installer package; if you chose Installer with Installer Loader from the Project Properties window, VSI will copy Windows Installer redistributables in the package output folder. From the Project menu, choose Launch Installer to test your package. Before distributing your installer, remember to set package configuration to Release from the Project Properties window.




The main purpouse of this article is not to be a guide to VSI, rather just a starting point, since it is quite hard to find documentation about VSI on the Internet.

You can also download the Windows Installer SDK from MSDN Web Site, very useful for C++ programmers, containing sample projects and documentation for Windows Installer programming.


Contact me at my e-mail address: alessandro.delsole@visual-basic.it or visit my Italian home page at http://community.visual-basic.it/Alessandro for more information.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date