creating setup for dif platforms

Posted on 2005-04-18
Medium Priority
Last Modified: 2011-09-20
i have a tax application  in vb6  which i am editing .The previous setup packaging was made in 3 different types
1) setup for xp and office xp
2)win98 with office xp
3) win 2000 with off 2000

The program is using the following refernces
1) ms word 10 object library , ms office 10 object library, activex data library, scripting runtime, ms dataenvironment, ms data report designer, internet controls,etc etc

since the program should run on all windows and office versions how do i  create the package. do i have to create different setups for different operating systems and office versions ?
Question by:mr_brij
  • 3
  • 3
  • 2
LVL 10

Expert Comment

ID: 13804940
You best bet for a start is not to use references to the different versions of word/office. Use late binding instead.

It can be usefull to put the reference in while developing the exe, since you get the intelli-type prompts, ideally using the earliest version of Office you want you application to work with. Then when you come to compile the application change your definitions to late binding ones and remove the reference.

Dim oWord as Word.Application
Set oWord=New Word.Application

Dim oWord as object
Set oWord=CreateObject("Word.Application").

As for needing different versions for different platforms, you will need to install different versions of some of the files depending on platform. For example the scripting package is different for Windows 98 (scr56en) to Windows 2000/XP (scripten).

I'm not sure if you can have different options within the package and deployment wizard for different versions of windows. The way I deal with this is to create my installs with Inno Setup (http://www.jrsoftware.org/isinfo.php), which is a powerful free installer package. I use Inno Script (http://www.randem.com/innoscript.html) to create the install based on my VB Project, then change the lines necessary. For example, the following 2 lines ensure the correct version of scripting is installed:
Source: c:\program files\innoscript\vb6 diff versions\scr56en.exe; DestDir: {tmp}; MinVersion: 4.1,4.0; OnlyBelowVersion: 0,5.0
Source: c:\program files\innoscript\vb6 diff versions\scripten.exe; DestDir: {tmp}; MinVersion: 0,5.0

The advantage of this is I don't need to know in advance what platform the software will be installed on. The install detects this and installs the required files.
LVL 29

Expert Comment

ID: 13804948
I don't think it matters, since there both 32bit operating systems and I assume you wrote the application in VB6.
Just remember to program your paths to deal with the different windows directories on each type of operating system.
In some cases a user creates his own windows folder. So it's not always standard.
So no you don't need to create different setup packages I believe P&D automatically knows what OS its installing the files on.
My only concern would be windows 98 users. The reason being I don't really know how some of those controls would react on the 98 system.


You could use some API to get the paths for each type of OS.


Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

 Dim RealPath As String, Cbuff As String
    Cbuff = String(200, Chr$(0))
    RealPath = Left$(Cbuff, GetWindowsDirectory(Cbuff, Len(Cbuff))) + "\anything.exe"
    MsgBox RealPath


Author Comment

ID: 13805436
thanks PSSuser your solution made a lot of sense.. but i have a little problem here.
Since the application is already made  and i am just making a small calculation change in one module so i dont think i would be able to remove the references and add late binding , that would take lot of time . Will the inno solution work if i do nothing with the existing code and just pack it up with the software you mentioned ??

Egl thanks for the reply you are right the application randomly works or sometimes doesnt in systems with win98 and word 97 . Mebbe that is the reason why the person who developed this program created different setup folders for win98, 2000 and xp.

so what is my best bet in this kind of situation ??



Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

LVL 10

Assisted Solution

PSSUser earned 180 total points
ID: 13807146
The setup will work with your existing app, you can tailor it for the different versions of windows quite easily.

You may have problems with the different versions of office, since if you code is looking for MS Word 10 on a machine that has a different version of word you will get an error. This can only be solved by either having different versions of the exe, depending on office version, or using later binding. If you have different versions of the exe for different versions of office, you can prompt the user for what version of office they are using, then get the setup file to install the appropriate exe.

Author Comment

ID: 13812663
thankss pss , i think i understood quite  a bit about setups. One last question though , since currently i am editing the program in win2k server with office xp machine visual basic has a reference of ms office 10 object library and ms word 10 object library.  To make different setups how do i find and add the object libraries for say win xp with  office xp or win 98 with office 97 ??

LVL 10

Expert Comment

ID: 13813528
The different versions of windows won't have an impact on the MS Office or MS Word references. Only the version of office will be important. The only way to be able to references to the different versions is to have a copy of each installed on your developement machine (or if you have several developement machines, have a different version of office on different machines).
LVL 29

Accepted Solution

nffvrxqgrcfqvvc earned 195 total points
ID: 13814050
What I ususally do is run package and deployment wizard, then I read the SETUP.LST file that PDW creates.  It will list all of the dependencies that need to be shipped with your application. In the setup.lst file you want to read the

[Bootstrap Files]
You need all of these files.

[Setup Files]
Lists all your dependecy files,ocx,dll etc..

I would just make sure that whatever setup you are using has an option do register the files on the system.
LVL 29

Expert Comment

ID: 13814058
I would also set the option to not overwrite existing files or {skip exisisting files}

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question