creating setup for dif platforms

Posted on 2005-04-18
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
    LVL 10

    Expert Comment

    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 (, which is a powerful free installer package. I use Inno Script ( 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

    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

    LVL 1

    Author Comment

    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 ??


    LVL 10

    Assisted Solution

    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.
    LVL 1

    Author Comment

    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

    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

    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

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

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    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…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    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…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now