Decal Development Forums Forum Index Decal Development Forums
www.decaldev.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Howto #7: Creating an Installer with Visual Basic, Part 2

 
Post new topic   Reply to topic    Decal Development Forums Forum Index -> AC FAQ's and Howtos (Archive)
View previous topic :: View next topic  
Author Message
Saitoh_TD



Joined: 19 Apr 2002
Posts: 110
Location: Cornfield, MO

PostPosted: Fri Apr 26, 2002 1:05 pm    Post subject: Howto #7: Creating an Installer with Visual Basic, Part 2 Reply with quote

Howto: Creating an Installer with Visual Basic, Part 2

Definitions:

MSI - Microsoft Installer
VBS - Visual Basic Script

Concepts:

OMG! I missed a part!

No, you didn't. Part one is Zyrca's manual (http://www.cs.colostate.edu/~cousinea/vb_decal_docs/ch8.htm) on creating an Installer. I'm just going to run through how to make one by hand from scratch with some more pointers.

In this howto, we will make an MSI from start to finish.

What you need:

Microsoft Installer 1.1 - That is a legit copy of VB you are using, right? Just enter your serial number and the installer creator is yours free! - http://msdn.microsoft.com/vstudio/downloads/vsi11/default.asp
Some devs use PiMP installer created by Nullsoft, which I guess the process of making one is similar, but since I've never used it, you'd have to ask someone else about the specifics of using it.

Initialize:

Similar to programming, we need to create our environment first. Open up Windows Installer Creator and click on VB Project. Then, enter the name of the project and folder that you are creating an installer for. Keep your installer and your code separate! If your project is named "MyPlugin", make the installer use "MyPluginInstaller".

When it asks for your project, select it and hit Ok.

Ok, here is our project. Before we get started, just a quick tip: If you want to reopen your project again, double click the .SLN file. If it claims something about a missing project, close it and open your project using the .WIP file instead.

Format your pages:

Lets start by making our plugin pretty, go to the User Interface Tab on the right side. Good, now we have a list of all the pages that Windows would show to our users. They are grouped into two major install type sections, Install Dialogs and Network Install Dialogs. Please tell me you aren't doing a full network deployment. Click the pages under Network Installer one by one and hit delete.

At this point, we really don't need to do anything else and can continue on. Or, we can add a picture to our Installer's GUI. Click on the First page of the normal install. There is a box on the bottom right that says "BannerImage". Select that and feed it an image. 500x60 is the size I use. Then continue to the other pages and apply your banner.

Add additional files:

Go to the Files tab on the top left. This is where you will stick in any other file that your program uses. This would be images, your XML file, or readme.txt files. Simply drag and drop them into the "Application Folder".

If you have other external "pieces" to your project that are different programs that you coded, you can add the "Output of Another Program" into this list, also. This could be anything from a helper program to a dll that your coded.

Registry:

Now, for the fun part, click on the Registry tab. As you notice, there are already some keys in the folder view. Remove them. *waves hand slowly* These aren't the registry keys that you are looking for.

Ever looked at your Decal's registry before? Go to Start->Run and type in RegEdit.

Decal stores all of it's programs in HKLM->Software->Decal->Plugins. HKLM is just the short way of saying HKey_Local_Machine. Below that is a bunch of {WHAT-THE-HECK-IS-THIS} things. I know, obviously, since your attempting to de deploy your plugin, that you've added your information into here in the past, but stick with me.

Here's what we are going to do. We are going to tell our installer to generate our keys during installation. Go back to the Installer Creator.

Add the key "Software" under HKLM. Under "Software", add "Decal". Under "Decal", add "Plugins". Under "Plugins", add "{MY-PLUGINS-ID}". Well, put your plugins ID in there with {}.

Time to add values.

Right click on the big white area and add a string value. When it asks for the name, delete it. When it is blank, hit enter. The text will change to (Default). This is the key that you slap in the name of your plugin. If you don't, people will see "MyPlugin.MyPluginClass" in their DenAgent. Also, don't manually type "(Default)", it will treat this as a completely different value.

Type the name of your plugin into the value field in the lowerr right properties set.

Cool, now add a DWORD, name it "Enabled". Set the value to 1.

Lastly, since this is VB, we need the surrogate key, so add "Surrogate". Set it equal to the surrogates ID, it's best to just copy it from a key in your registry.

Excellent, we are done here.

Build:

The only thing left now is to hit build. When you do that, the creator will do it's bump and grind and stash a file called MyPlugin.msi in the ..\Output\Disk_1 folder.

You'll want to make sure it works, so remove your programs entries from your registry and run your installer. Check to make sure it appears in Decal and does not say <No DLL>.

If it does, run uninstall and make sure it works.


Summary:

At this point, you can do things like encapsulate it with a VBS script that removes previous versions of your plugin during installation. The trade-off to this is that you will see posts saying "WTF I CAN"T INSTALL MYPLUGIN CAUSE IT SAYS VBSCRIPT.DLL ERROR???????"

On the flipside, it will cut down the posts that say "I am having X error that the FAQ says was fixed", because their old version didn't get replaced.

Unfortunately, I don't know how to add in a VBS quite yet. When I do, I'll add it to this Howto.
_________________
- Navi - Navi II - Navi III -
http://www.saigumi.net
http://navi3.sourceforge.net
Back to top
View user's profile Send private message Send e-mail Visit poster's website
-Lexicon-



Joined: 06 Nov 2002
Posts: 6

PostPosted: Mon Dec 02, 2002 5:22 pm    Post subject: Reply with quote

This is a great Howto and I appreciate having access to it. Thank you for taking the time to write this up. I would also appreciate seeing a Howto on creating an installer with VB.NET. For instance:

1. How to create the installer project.
2. How to build the appropriate version -- debug vs. release.
3. How to set the version/build number in project.
2. How to include the necessary files (dlls, assemblies, interops, etc.).
3. How to enter registry keys in the installer.
4. How to auto-reg the decal plugin at install time.

I'm sure there are other tasks that I'm not aware of. But I'm sure there are several people that want to make the transition to VB.NET but may be holding off until more information is written about topics like this one.
Back to top
View user's profile Send private message
Kaltemar



Joined: 08 Jun 2003
Posts: 38
Location: New Zealand

PostPosted: Tue Jun 17, 2003 12:49 am    Post subject: Reply with quote

Just so you know, it is not possible to add in a VBS to a Windows Installer Project created with the Visual Studio Installer. You will be better off using either WISE InstallMaster, Nullsoft Install System, or InstallShield (yuck!) for your installer.

Sorry to have to break that to ya!
Back to top
View user's profile Send private message Visit poster's website
Pip



Joined: 03 Sep 2003
Posts: 268

PostPosted: Mon Feb 28, 2005 9:21 am    Post subject: Reply with quote

FYI the above like for the install creator is bad.
It took me awile but i found it here.

http://msdn.microsoft.com/vstudio/downloads/tools/vsi11/download.aspx
Back to top
View user's profile Send private message
Pip



Joined: 03 Sep 2003
Posts: 268

PostPosted: Sat Mar 05, 2005 11:57 am    Post subject: Reply with quote

I am having TONS of issues with only some people seeing my plug-in when loaded and i have been pulling my hair out trying to find the problem.

It works perfect me on 4 workstatsion. It even works right for some people. Others can not seem to get it to show up at all no matter what they load.

I have gone through ALL versions of filters/decal/xml/Decal Support Libraries/VB runtimes etc etc but can not resolve the issue.

When i create the installer, i get a few msg that i need help determining if it is my problem.

5 items in my task list show up.

neither a merge module nor dependency information could be found for c:\program files\impfilter\impfilterv2.dll

neither a merge module nor dependency information could be found for c:\winnt\systems32\msxml3.dll

One or more files in MSVBVM60.MSM have different versions then those on this machine

One or more files in MDAC.MSM have different versions then those on this machine

One or more files in OLEAUTH32.MSM have different versions then those on this machine



In my dependacies section of the installer project i have additional files other then my project that show.

COMCAT.MSM
MSDERUN.MSM
msxml3.dll


All of the above listed in the errors, Impfilter2 and the Decal dlls
I removed the dependacies to the decal dll files becuase it will install them to the plug-in folder.

Im at a loss here Sad
Back to top
View user's profile Send private message
Pip



Joined: 03 Sep 2003
Posts: 268

PostPosted: Sat Mar 05, 2005 12:45 pm    Post subject: Reply with quote

I changed my reff of msxml30 to msxml40 and rebuilt
Same issue

I ran a Dependency Walker but can find a way to export the output Sad

There is a bloody mark on my head from beating it on the desk.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Decal Development Forums Forum Index -> AC FAQ's and Howtos (Archive) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group