Solved

How to create a Installation file for a VBA project

Posted on 2009-07-09
41
1,077 Views
Last Modified: 2013-12-20
How can we create an Install File like in VB6 ("Package & Deployment Wizard") but for VBA?

Current VBA version is 6.5
0
Comment
Question by:rayluvs
  • 21
  • 10
  • 8
41 Comments
 
LVL 84
ID: 24818001
VBA is application dependent - that is, you cannot have a standalone "VBA Project" ... it must be tied into another application, like Word or Access.

Depending on what you're doing, you can often simply copy/paste an Access database. If you need a more professional installation tool, you might consider Advanced Installer (www.advancedinstaller.com - they have a free version) or the Sage Installation system (www.sagekey.com)
0
 

Author Comment

by:rayluvs
ID: 24818098
Thanx.

I understand VBA is tied to another application, i.e, Access, Word, Excel, etc., but before download and testing links given, can they produce an Install or setup of a VBA project?

This is what whats happening right now.  We are developing in VBA for Microsoft Great Plains (I assume that all VBA behave the same, correct me if I'm wrong).  We have finished the project and its a lot of code.  There are over 10 workstation and what we want is to install the VBA code developed via a setup programs, instead of importing, adding the references, configuring, etc.



0
 
LVL 84
ID: 24818240
I'm not familiar with Great Plains and the process, but apparently there is something called "Customization Maintenance" where you can determine what to "package", then export that ... then move it to the client machine and Import it into the client's Great Plains program.

Perhaps this will help:
http://msdn.microsoft.com/en-us/library/ms994230.aspx

0
 

Author Comment

by:rayluvs
ID: 24818332
We're familiar with the link provided and "Customization Maintenance".  Unfortunately, we haven't been able to find anything to deploy VBA.

Question:  in your experience, what application with VBA permits to package and created setup files? Can that be done?
0
 
LVL 84
ID: 24818387
I'm not sure. I deal primarily with Access, which doesn't allow producing standalone VBA projects. Perhaps you should ask this in the Great Plains zone:

http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Dynamics/Great_Plains/#browseZones

Use the Request Attention link above to ask the mods to move/add that TA.
0
 

Author Comment

by:rayluvs
ID: 24818420
thanx
0
 

Author Comment

by:rayluvs
ID: 24818450
One last question, do you know a any VBA apps that does permit to create an Install/Setup for deploying VBA programs?
0
 
LVL 84
ID: 24818484
No. I've never seen one that could create VBA apps.
0
 

Author Comment

by:rayluvs
ID: 24818493
Ok Thanx.  Lets see what the MOD says.
0
 
LVL 1

Accepted Solution

by:
jjthomas3 earned 400 total points
ID: 24819683
I suggest, that if you know where the files need to go and what to update with in the system, you can use a freeware piece of software called Inno Setup compiler, which will allow you to build, rather easily, a setup.exe program.  If your VBA needs DLLs registered on the system it can handle that and registry read/writes and the whole 9 yeards. I love it. But make sure you get the Tools as well, it gives you a nice drag and drop gui that makes life easy. Even creates an uninstaller too, if you like.

 Anyway the site for inno is located here:
http://www.innosetup.com/

 You want to download the ISPack (quick start kit) and make sure to install the ISTool editor, that's the GUI add on.
0
 
LVL 1

Expert Comment

by:jjthomas3
ID: 24819720
As a side note, I've used Inno setup compiler to:
Create installers for VB/VBA Applications, C#, JAVA, and c++ apps.
Distribute system-wide registry changes in corporate network environments.
Uninstall other applications (you can have it launch stuff at the end of an install)
Distributing multiple MS Hotfixes in one nice easy setup.exe
0
 

Author Comment

by:rayluvs
ID: 24819763
Sound exactly what we need.

Thanx lots.

We're downloading right now.

Just to be clear, Inno Setup 5.2.3  is the actual programs?

and Toolbar2000 2.2.2 MUST alsoi be installed?

Please advice

0
 
LVL 1

Assisted Solution

by:jjthomas3
jjthomas3 earned 400 total points
ID: 24819784
No you don't need the Toolbar 2000 stuff..... Essentually you need 2 things Inno setup compiler and ISTool kit. It doesn't hurt to install the other items, you may need them later for other projects...but for now.....no need.

Great Plains, thats a very complicated piece of software from Microsoft for Managing Corporate finances if I am correct, I used to support it at Dupont. Hated it, we used to call it Great Pains.  I remember that our IT staff refused to perform a lease refresh on a few workstations that it existed on...they were too scared to muck it up with all the loos SQL and VB files etc...

You should be able to do what you need.
0
 
LVL 1

Expert Comment

by:jjthomas3
ID: 24819794
Oh, actual program is ispack-5.2.4.exe

It will handle all the loose ends for you.
0
 

Author Comment

by:rayluvs
ID: 24819839
Maybe your are referring to the initial SQL version or before (I worked with it since its DOS days).  GP has changed & moved up and I gotta tell'ya super friendly and powerful and best of all, you can modify it to whatever you want; making a great Value Added product and great income!  

Anyways, I guess its just a matter of choices; any question or assistance, feel free to ask; EE has been great for us here, why not give something back

Going back to my issue, all I need to download is ispack-5.2.4.exe, nothing else?

0
 
LVL 84
ID: 24819860
Inno Setup is nothing more than an standard install packager, just like Advanced Installer.
0
 

Author Comment

by:rayluvs
ID: 24819870
Understood, but all I need to download is ispack-5.2.4.exe or anything else?
0
 
LVL 1

Expert Comment

by:jjthomas3
ID: 24819880
Yup, thats it. ispack-5.2.4.exe

And as far as the user experience for Great Plains, my user base loved it.

-john
0
 

Author Comment

by:rayluvs
ID: 24819904
Thanx!

We'll give it try!
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:rayluvs
ID: 24819937
Just finish installing and its kinda' intimidating (jaja).  It looks like I have to detail all I want to include (????)

Can you give me an example of creating the installer.

Ok, basing on that I have to "Indicate" all resources for the project, can you give me an example based on the following:

I exported my VBA project whcih consiste of Microsoft Dynamics GP Objects:
CostonVendorsInvoice (Extender).cls
PurchasingInvoiceEntry.cls
PurchasingInvoiceEntry (Grid).cls
Module1.bas

my VBA References (for this example):
Ms ActiveX Data Objects (..\..\msado15.dll)

This is so I can understand it.

Thanx
0
 
LVL 84
ID: 24821888
When this is moved to the client's computer, how do they "install" this into GP?

The ADO reference should include the ENTIRE MDAC file, or check to see if this has been installed on the end user machine. You don't simply install the msado15.dll file - you must install the full file. However, many times you would simply check to see what's on the end user machine - in most cases, the correct version will be there.
0
 

Author Comment

by:rayluvs
ID: 24822032
I just used that file as an example.

I need to see an example of to setup the script.
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 100 total points
ID: 24822051
This sites shows how to use Inno:
http://www.ita-software.com/papers/FT410_Borup_InnoSetup2.pdf

The FAQ has some examples:
http://www.innosetup.com/isfaq.php

I'd still like to know how the user's GP program will "install" the files you send out ... just curious really
0
 
LVL 1

Assisted Solution

by:jjthomas3
jjthomas3 earned 400 total points
ID: 24822390
The most simple basic way is to start with ISTool, Create a basic project and go through all the properties such as company name, product name version etc. I typically go through all the options and build setup exe with out specifying a single project file. Once it compiles an empty setup.exe successfully, you know that your settings and version strings are accurate.

Next drag and drop your project file into the interface (ISTool),. Once you do that you can maintain a directory structure for the files or specify different locations to install them to. DLL files you can choose to have registered with the OS.

 Once you're happy with the files install locations, and the basics like that you can create a BATCH file or exe file, if need be to, launch any necessary SQL scripts or to execute any GP commands. If you're using ISTool's GUI you'll see on the left pane you have specific areas for Registry Settings, Files, Icons, Post-install programs to run (post-install tasks).  You can also have INNIO directly execute any commands from the GP Binaries.

 It may look intimidating at first, but once you get the hang of it, you'll find it well worth the very short learning curve.
0
 

Author Comment

by:rayluvs
ID: 24822728
Hi, and excuse the continuous questions (this is totally new to me), but...

1. What do you mean by "go through all the properties "?  
    You mean go to Tools -> Project Properties, or Tools -> Options?

2. What do you mean by "go through all the options and build setup exe with out specifying
    a single project file"?

3.  Attached is my Tools -> References used with VBA window.  I assume that if I manually import
     my VBA to another PC, I have to also goto Reference and included these files.  How do I say to
     the install that these files need to be included in the setup?

Again, thanx for patience
EE.VBA.ReferenceSCRN.jpg
0
 
LVL 1

Expert Comment

by:jjthomas3
ID: 24827065
1. First go through the project properties, set the company name, the product name, version, default output filename(setup.exe), default install directory. Basically setting up the skeleton of the project.  Not worring about any files or shortcuts or tasks.

2. Once you're done with #1 compile the installer and make sure it compiles AOK. It's much easier to troubleshoot the install when you know the framework is good. Sometime Inno might not like a version string or the way the company name was specified. This is a way to flush that out before you get into the real meat and patotos....start with a good foundation.

3. Now start dragging and dropping your VBA files, specifying their destination folder(s). don't worry about any external DLLs just yet, or OCX Files. Once done here you can compile and test for any issues/errors. You can also specify options like "over write existing" or "overwrite older files" and whatnot. This allows you to maintain versioning, inno supports upgrade paths for future versions of your VBA (a bit more complicated) (once the files are in the project and in the GUI you can right-click and choose properties to see all the installation options for each file).

4. Bring in the required OCX/DLL files(your project references) by locating them and draging and dropping them into inno, set their destinations. Now here's where you want to specify to register the DLL files. You can specify options to test for existing versions/ as well here if you look at the properties. I typically do not install DLL files if they already exist and are the same version, INNO handles this AOK. As LMS points out MDAC is likely to already exist, especially if GP is already installed on the system.

I've attached a full ISS file generated by the IS tool of a project I wrote a few years back, but I didn't touch the script. I just used the GUI to set up everything.  


5. You


Setup]

AppCopyright=2008 John J Thomas

AppName=WMI Asset Logger

AppVerName=WMIAL 5.7f

DisableStartupPrompt=false

AlwaysShowDirOnReadyPage=true

AlwaysShowGroupOnReadyPage=true

ShowLanguageDialog=no

LanguageDetectionMethod=locale

WizardImageFile=C:\Program Files\Inno Setup 5\WizModernImage-IS.bmp

OutputDir=C:\wmisources\WMIAssetLogger\Bin

OutputBaseFilename=setup-wmial5.7f-db

VersionInfoCompany=John J Thomas

VersionInfoDescription=WMI Asset Logger

AppPublisher=John J Thomas

AppPublisherURL=http://johnjthomas.net/

AppVersion=WMIAL 5.7f

AppSupportURL=http://johnjthomas.net/

AppUpdatesURL=http://johnjthomas.net/

AppID={{EE33E6FB-C177-48D9-A5CE-191B9A9C204D}

UninstallDisplayName=WMI Asset Logger Free

AppComments=WMI Asset Logger Installer Build 2.57

AppContact=John J Thomas

DefaultDirName={pf}\WMIAL-Free

DisableProgramGroupPage=false

DefaultGroupName=WMI Asset Logger

SetupIconFile=C:\wmisources\WMIAssetLogger\Icons\Current\15.ico

InfoBeforeFile=INFOBEFORE.rtf

LicenseFile=EULA.rtf

SourceDir=C:\wmisources\WMIAssetLogger\Installer

VersionInfoVersion=5.7

VersionInfoTextVersion=WMI Asset Logger 5.7

VersionInfoCopyright=2008 John J Thomas

WizardSmallImageFile=C:\Program Files\Inno Setup 5\WizModernSmallImage-IS.bmp

[Files]

Source: COMDLG32.OCX; DestDir: {app}; Flags: regserver noregerror

Source: WMIAL57.exe; DestDir: {app}; Flags: overwritereadonly ignoreversion replacesameversion uninsnosharedfileprompt

Source: epRegPro.ocx; DestDir: {app}; Flags: regserver noregerror

Source: MBFormEx.ocx; DestDir: {app}; Flags: regserver noregerror

Source: MBTipDay.ocx; DestDir: {app}; Flags: regserver noregerror

Source: MSWINSCK.OCX; DestDir: {app}; Flags: regserver noregerror

Source: tabctl32.ocx; DestDir: {app}; Flags: noregerror regserver

Source: lastsuccessful.dat; DestDir: {app}

Source: m1tod.dat; DestDir: {app}

Source: wmial.ini; DestDir: {app}

Source: wmial-assets.mdb; DestDir: {app}; Flags: confirmoverwrite uninsneveruninstall

Source: wmialtip.dat; DestDir: {app}

Source: MSVBVM60.DLL; DestDir: {sys}; Flags: regserver noregerror uninsneveruninstall onlyifdoesntexist

Source: msvbvm50.dll; DestDir: {sys}; Flags: regserver noregerror uninsneveruninstall onlyifdoesntexist

Source: blacklist.ini; DestDir: {app}

Source: WMI Asset Logger on the web.url; DestDir: {app}

Source: EULA.doc; DestDir: {app}

Source: WMI Asset Logger Manual.doc; DestDir: {app}

Source: MSCOMCTL.OCX; DestDir: {app}; Flags: regserver noregerror replacesameversion

Source: Help.ico; DestDir: {app}

Source: Internet Explorer.ico; DestDir: {app}

Source: RemInstaller.exe; DestDir: {app}\RemInstaller; Flags: ignoreversion replacesameversion overwritereadonly

Source: reminstaller.ini; DestDir: {app}\RemInstaller; Flags: overwritereadonly ignoreversion replacesameversion

Source: InstallNow.exe; DestDir: {app}\InstallNow; Flags: overwritereadonly ignoreversion replacesameversion

Source: InstallNow.ini; DestDir: {app}\InstallNow; Flags: overwritereadonly ignoreversion replacesameversion

[Icons]

Name: {group}\View the Database; Filename: {app}\wmial-assets.mdb; WorkingDir: {app}

Name: {group}\WMI Asset Logger; Filename: {app}\WMIAL57.exe; WorkingDir: {app}

Name: {group}\User Manual; Filename: {app}\WMI Asset Logger Manual.doc; WorkingDir: {app}; IconFilename: {app}\Help.ico; IconIndex: 0

Name: {group}\WMI Asset Logger on the web; Filename: {app}\WMI Asset Logger on the web.url; WorkingDir: {app}; Comment: WMI Asset Logger on the web; Flags: createonlyiffileexists; IconFilename: {app}\Internet Explorer.ico; IconIndex: 0

Name: {group}\{cm:UninstallProgram, WMI Asset Logger}; Filename: {uninstallexe}

[Dirs]

Name: {app}\ImportFiles

Name: {app}\CSVDumps

Name: {app}\RemInstaller

Name: {app}\InstallNow

[Run]

Filename: {app}\WMIAL57.exe; WorkingDir: {app}; Flags: nowait postinstall; Description: Run WMI Asset Logger Now!

Filename: {app}\WMI Asset Logger Manual.doc; WorkingDir: {app}; Description: Read WMI Asset Logger's Manual; Flags: nowait shellexec skipifdoesntexist postinstall unchecked skipifsilent

[INI]

Filename: {app}\WMI Asset Logger - website.url; Section: InternetShortcut; Key: URL; String: http://www.johnjthomas.net/

[UninstallDelete]

Type: files; Name: {app}\WMI Asset Logger - website.url

[InstallDelete]

Name: {app}\WMIAL56.exe; Type: files

Open in new window

0
 
LVL 1

Expert Comment

by:jjthomas3
ID: 24827342
Wow, that was wierd my Router crashed mid post..I've never seen a partial post from a disconnect. :)

Step 5, this is where I typically would write a batch file or VBS script(in rare cases a c# exe) to handle any remaining tasks. For instance if you need to execute sqlcmd.exe calls for SQL files to modify a database, or if you need to execute specific GP utilities upon completion, you can take advange of VBS to log the results and make decisions based off of return errorcodes or whatever logic you may need.
0
 

Author Comment

by:rayluvs
ID: 24861154
Thanx Lots!  we'll get on it ASAP.

Question (just to make sure), when you say 't dragging and dropping your VBA', you mean the VBAs files (*.vba); mines for exmple rae are du3278.vba, DU3107.vba, etc.

0
 

Author Comment

by:rayluvs
ID: 24868830
I just ran with the Wizard and workes excellent for my VB files, however for my VBA I have this problem:

When in VBA, there is no executable to install, only *.VBA is present.

Do I have to have a *.EXE for this part of the Wizard?
0
 

Author Comment

by:rayluvs
ID: 24889749
Any Advice on this?
0
 
LVL 84
ID: 24893834
Does Great Plains have any sort of mechanism by which you can "install updates" or something along those lines? It would seem to me that you'd install your files to a particular location, then "launch" GP (or whatever tool is used on the client machine to "run" the update).

0
 

Author Comment

by:rayluvs
ID: 24894577
There is no mechanism for VBA install.  It's just that last question on *.EXE that we're in need of advice.
0
 
LVL 84
ID: 24895364
My point is this: As jjThomas3 said in their "step 5",

"or if you need to execute specific GP utilities upon completion"

That's what I've been trying to say - you cannot simply deploy your VBA class modules and such and expect Great Plains to "see" them ... there has to be some method in Great Plains to "install" those items ... most VBA-based apps don't have anything like this (i.e. you must redeploy the entire project) but GP might be different. Your VBA project wouldn't have a typical .exe file .. your install would have to copy the needed files, then launch Great Plains, or some other utility, in order to integrate those changes.
0
 

Author Comment

by:rayluvs
ID: 24897125
Understood.  "step 5" is well taken in consideration.  As for "...GP utilities upon completion",  "GP utilities" has to be executed only if there is a GP update or upgrade.   For VBA I am not aware of any sequence or need for "GP Utilities" to be executed.  I consulted some of my partners and non has indicated that "GP Utilities" is needed for any VBA routine/apps included.  When they have to install any VBA, they just include any references and then import the package.  Non of them have an application to create Deployment (all is done manually).

So in essence, I come back to my question: there is no executable to install, only *.VBA or classes that has been modified or created.  The wizard requires a *.EXE.  How can I complete this process if I don't have any *.EXE?


0
 
LVL 84
ID: 24897307
You could just include a bogus .exe file (just rename a text file with the .exe extension) if you must have one.

I assume then that your users would have to "import the package" into their GP installations?
0
 

Author Comment

by:rayluvs
ID: 24897329
Never thought of that.  Will try, Thanx!
0
 

Author Comment

by:rayluvs
ID: 24918765
Yes.  the admin has to import the packages.  I tried the bogus .EXE and it was successful.  I think that I have to import all packages rather having a setup program doing ut.  Then again I may be doing something wrong.



0
 

Author Comment

by:rayluvs
ID: 25064253
I'll close the question.  I have enough to play with.
0
 

Author Closing Comment

by:rayluvs
ID: 31601808
The installation setup was only partially successful, but we this we'll use it for other apps.

Thanx
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

20 Experts available now in Live!

Get 1:1 Help Now