Link to home
Start Free TrialLog in
Avatar of jana
janaFlag for United States of America

asked on

How to create a Installation file for a VBA project

How can we create an Install File like in VB6 ("Package & Deployment Wizard") but for VBA?

Current VBA version is 6.5
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

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)
Avatar of jana

ASKER

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.



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

Avatar of jana

ASKER

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

https://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.
Avatar of jana

ASKER

thanx
Avatar of jana

ASKER

One last question, do you know a any VBA apps that does permit to create an Install/Setup for deploying VBA programs?
No. I've never seen one that could create VBA apps.
Avatar of jana

ASKER

Ok Thanx.  Lets see what the MOD says.
ASKER CERTIFIED SOLUTION
Avatar of jjthomas3
jjthomas3
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of jana

ASKER

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

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, actual program is ispack-5.2.4.exe

It will handle all the loose ends for you.
Avatar of jana

ASKER

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?

Inno Setup is nothing more than an standard install packager, just like Advanced Installer.
Avatar of jana

ASKER

Understood, but all I need to download is ispack-5.2.4.exe or anything else?
Yup, thats it. ispack-5.2.4.exe

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

-john
Avatar of jana

ASKER

Thanx!

We'll give it try!
Avatar of jana

ASKER

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
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.
Avatar of jana

ASKER

I just used that file as an example.

I need to see an example of to setup the script.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

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

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.
Avatar of jana

ASKER

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.

Avatar of jana

ASKER

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?
Avatar of jana

ASKER

Any Advice on this?
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).

Avatar of jana

ASKER

There is no mechanism for VBA install.  It's just that last question on *.EXE that we're in need of advice.
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.
Avatar of jana

ASKER

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?


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?
Avatar of jana

ASKER

Never thought of that.  Will try, Thanx!
Avatar of jana

ASKER

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.



Avatar of jana

ASKER

I'll close the question.  I have enough to play with.
Avatar of jana

ASKER

The installation setup was only partially successful, but we this we'll use it for other apps.

Thanx