 |
|
 |
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Creating an installer..
quote: well, all you really need is what are needed for your program to run on other machines... like dlls, ocxs, fonts, registry data...
Well, its not that simple. For instance, VSI has put some files in application folder that needed to be in Windows system folder in order to work. For instance, concernig my problem with CR, the resolution was to move co2c40en.dll to system folder and it worked like charm.
Then, when I wanted to upgrade some of my earlier projects which installation was made using PDW, I had problems with registering DAO library (dao350.dll). By default, VSI puts it in app folder and doesnt regoster it. So, on new OS where no DAO objects where installed, it couldnt create DAO objects. This can be solved by setting Register property to vsifrSelfReg. But, then again, if dao350 was alredy installed, when uninstalling ur app it will unregister it, and other applications wont be able to work (like VB6 for instance ), so you would need to set SharedLegacyFile property to True....
All this is not neccesary to do with PDW, cause he does it all, altough VSI looks more proffesional. Also, PDW was causing me serious problems when installing on Win2K machines, it never started actual program setup, it always asked me to restart in order to apply changes that are made and I never actually maanged to get the welcome screen for installing app.
But, in time, you learn how to handle with VSI, so it is much better choice than PDW.
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
18-12-2003 at 11:11 PM |
|
|
yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Creating an installer..
Just a note, Goran (I've been cranking my head over MSDN about MSI for all the weekend...)
About DAO files, you could set the correct installation dir - Common Files dir - by adding a new special dir in the Installer project (they call the project a 'solution'): in the right pane, double click on File System under the Target Machine node, and on the File System window that appears, right click on a folder and choose Add Special Folder. Special folders avaliable are many, included Common Files folder, the right one for dao350.dll. In fact, you better check all the dependecies files' SourceFile property, in order to place each one in the right folder on target machine. So, no need of SharedLegacyFile = True, nor vsifrSelfReg (MS lords suggest never use this setting, so why they put in it?...).
It's amazing to me that among the avaliable special folders there's not the Start Menu\Programs folder. If I select the Start Menu folder as destination of a certain file, it places it in the root of Start Menu. Well, perhaps I must study it a bit more... (any hint?)
HTH
____________________________
Real Programmer can count up to 1024 on his fingers
|
|
18-01-2004 at 05:47 PM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Creating an installer..
Yes, Yronium, that is correct. To be precize, Common Files FolderMicrosoft SharedDAO is the appropriate folder for daoX.dll's. Thats the place where I also install them.
But, as I know, if you dont use vsifrSelfReg, on machine where no DAO library exists, it will display message like : DAO library not correctly installed, or registered, dont remember which.
Again, if you dont set SharedLegacyFile = True, it will uninstall it, no matter if any other application used it before you installed your app.
As I said, this is from my experience, I have installed several times fresh WinXP and Win98 OS in order to check if it works.
As for Start Menuprograms folder, the resolution would be in creating these folders: User's Start MenuProgramsYourApp and pasting your shortcut there.
Just a note, If you install your app on Win98, you will need InstMsiA.exe and Mdac_typ.exe in order to complete your installation succesfully.
[Edited by Goran on 18-01-2004 at 07:56 PM GMT]
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
18-01-2004 at 06:43 PM |
|
|
yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Creating an installer..
quote: Goran wrote:
... if you dont use vsifrSelfReg, on machine where no DAO library exists, it will display message like : DAO library not correctly installed, or registered, dont remember which.
Again, if you dont set SharedLegacyFile = True, it will uninstall it, ...
I don't know. I made several install/uninstall tests minutes ago, so now I should have unistalled DAO. I'm gonna try it. I just ran once the .exe file, it gave me a Type Mismatch error, but it seems not related to dao. I need to run it step-by-step in the VB IDE, and I'll do it in a while.quote: As for Start Menuprograms folder, the resolution would be in creating these folders: User's Start MenuProgramsYourApp and pasting your shortcut there.
Yeah, OK, but what about the localized version of the apps? You should know the Start Menu Programs folder's name of each language you need to distribute, and create a different .msi pack for each language, isn't it? (Anyway, it's not my actual case). I had figured this solution out, just have to try.quote: Just a note, If you install your app on Win98, you will need InstMsiA.exe and Mdac_typ.exe in order to complete your installation succesfully.
I use Win98, though I must install my actual app on a W2K and a XP machine. I already tested the executable on these pcs, and they worked, but it's a useful tip and I'll do it. Just: where should I find, and put, those files in the .msi project?
Thanks for the reply
PS: your uninstalling idea in the other thread works fine. I'll post there too, to benefit all the readers of that post.
____________________________
Real Programmer can count up to 1024 on his fingers
|
|
18-01-2004 at 09:18 PM |
|
|
yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Creating an installer..
OK, I'll have a look into. (What do you mean by 'pointless'?)
I checked my pc, and no problem with DAO. The error I got was due to a bug im my app, and I fixed it. I ran it without any installation, and got no misworking. I picked out some old MSAccess dbs in which i placed many DAO funcs, but everythig worked properly. I also found dao350.dll actually in its place, C:\Program Files\Common Files\Microsoft Shared\DAO folder. So it seems it didn't uninstall it. (Anyway, I believe SharedLegacyFile = True is always a good choice for dao, ado and other db engines, because users will probably need them again sooner or later).
I'll try running the .msi, and then uninstall it, out from the MSI environment, but as I read in MSDN site, the debug function in the Installer IDE creates an effective installation, the same we obtain running the .msi file out of it, so I'm expecting no changes, even about DAO. I'll tell you.
____________________________
Real Programmer can count up to 1024 on his fingers
|
|
18-01-2004 at 11:02 PM |
|
|
yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Creating an installer..
As I said before, no problem with DAO. But I experienced another strange behaviour. Listen here:
I made my .msi files (two), and made a small Launcher.exe app, that chooses which one's to launch. It prompts user 'Do you want to install Module1 or Module2 ?', then according to user's choice launches the msiexec.exe file, with Module1.msi or Module2.msi file as parameter, and then closes itself.
(I first coded to run the .msi file directly by the Shell function, but it gave me an 'Invalid argument' error, so then I coded Shell SystemPath & "\msiexec.exe /i" & ModuleFile and it worked properly)
I stored it all in a removable storage device, tested it and everything worked. I stored it all in a hard disk, and again everything worked fine. So, I was ready to burn an install cd.
Prepared the autorun.inf file, and burned the cd.
Put the cd into the drive, the autorun made its duty, launched the Launcher.exe, then I selected the module, the Windows Installer windows 'Preparing the Windows installation' appears, but then.... an error: 'Unable to open install package. Contact application provider to verify the Windows Installer package is a valid package'. Then, the desert!
The funny thing is the following: I manually open the cd, locate the Module1.msi file (or either the Module2.msi), double click it, and it performs the installation as usual.
Today I tried it in four different pcs, and always the same behaviour.
What do you mind, can you explain this?
____________________________
Real Programmer can count up to 1024 on his fingers
|
|
19-01-2004 at 11:31 AM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Creating an installer..
Pointless - as no point in doing that.
Why would you include two files that are necessary on some OS to be installed, in order msi installation to work. So, if you include them in your installation (soution), this instalation cannot be started (due to above mentioned reasons) on some OS. WindowsXP, however, doesnt need this files, cause it already has them installed.
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
19-01-2004 at 11:39 AM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Creating an installer..
No point of doing that - means that you are doing something that will have no results, so you shouldnt do it.
When you installed Windows installer, he installed all the necessary files. That is why I suggest you to install fresh new Win98, and then try to run your installation on it. Then you will see what I am talking about. Project installation shouldnt be tested in working area, cause u have there all the dlls properly installed. As for DAO, you can test if it works by unregistering it with regsvr32 ... /u, and then start your installation. If your program works, then you will know that it is properly installed. But, as I said, install fresh new OS and testing it there would be the best thing to do.
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
19-01-2004 at 12:14 PM |
|
|
yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Creating an installer..
(So, if I'm right: "pointless" = "no doubts on doing it, do it, do it absolutely, do it now, why didn't you do it yet?, do you need Sister Act to help you put these files in your solution, guy?", am I right?)
So, if you need to install fresh an OS for each misworking I find, how long does it take to debug an app? I really believe you've done it, but it's a bit hard to me.
First: I don't have the cds of the OSs my app is destined.
Second: my app is destined to two specific pcs, and I know they already have dao, ado and other stuff installed, included over all Windows Installer (I'm aware this is not a general rule, but I'm in a hurry now for them)
Third and more: I don't really think that there are more than the five percent pcs in the world not using Windows Installer. It's been distributed first with MS Office 2K, so four years ago, and quite all the software avaliable since then use WI, that installs itself before making any installation. In my pc, installing and reinstalling various application, WI has been reinstalled and configured about a hundred times in four years. Anyway you're right: I could find an user that don't have it. But even in that case, couldn't I give him a special .msi pack with the two files included?
But anyway, this is only theory, and you're right, it takes only two minutes to me to include these files in my packs.
Only, now I'm urged with the above cd bug, and I need to solve it asap. I'll try this way too.
____________________________
Real Programmer can count up to 1024 on his fingers
|
|
19-01-2004 at 12:46 PM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Creating an installer..
quote: So, if I'm right: "pointless" = "no doubts on doing it, do it, do it absolutely, do it now, why didn't you do it yet?, do you need Sister Act to help you put these files in your solution, guy?", am I right?)
No, no, the opposite. Pointless=unwise=meaningless=absurd=silly=No point of doing that=means that you are doing something that will have no results, so you shouldnt do it.
Now, considering this two files. Simple example: lets say that your app installation name is Setup.msi. You would need to have all 3 files on CD.
(1) Setup.msi.
(2) InstMsiA.exe
(3) mdac_typ.exe
Lets see when you wll need to use them ( (2) and (3) ).
Issue:
When u click on setup.msi it opens a Open with dialog (.msi extension not recognized by OS).
Resolution:
What you would need to do is start InstMsiA.exe. But, if MDAC is not installed, it will ask from you to install it before you can start InstMsiA.exe. So, you would need to install (3), then (2) and at last (1).
Anyway, none of this is not causing problem you are dealing with. I suggested that you should try to execute installation with API ShellExecute instead of Shell command, maybe that would help.
Hope I have cleared some things for you now.
[Edited by Goran on 19-01-2004 at 03:10 PM GMT]
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
19-01-2004 at 02:08 PM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Creating an installer..
I think the best and easiest way for you would be to create readme.txt file, where you would explain the user how to deal with problems that occur. I think (but not sure) that when mdac is installed OS needs to be restarted. So, this will only make you more problems (after restarting you would need to detect if your setup was launched, so u should continue where you were), if you think of handling it with your app automatically.
I am glad that ShellExecute worked for you. Why Shell didnt work, that I dont know. You could go step by step, for instance, launching only msiexec, without any parameters. If it display a msgbox, requesting parameters,then you will know that it works, and that parameters are causing error.
Here is description for ShellExecute:
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
· hwnd
Specifies a parent window. This window receives any message boxes that an application produces. For example, an application may report an error by producing a message box.
· lpOperation
Pointer to a null-terminated string that specifies the operation to perform. The following operation strings are valid:
“open”
The function opens the file specified by lpFile. The file can be an executable file or a document file. The file can be a folder to open.
“print”
The function prints the file specified by lpFile. The file should be a document file. If the file is an executable file, the function opens the file, as if “open” had been specified.
“explore”
The function explores the folder specified by lpFile.
The lpOperation parameter can be NULL. In that case, the function opens the file specified by lpFile.
· lpFile
Pointer to a null-terminated string that specifies the file to open or print or the folder to open or explore. The function can open an executable file or a document file. The function can print a document file.
· lpParameters
If lpFile specifies an executable file, lpParameters is a pointer to a null-terminated string that specifies parameters to be passed to the application.
If lpFile specifies a document file, lpParameters should be NULL.
· lpDirectory
Pointer to a null-terminated string that specifies the default directory.
· nShowCmd
If lpFile specifies an executable file, nShowCmd specifies how the application is to be shown when it is opened. This parameter can be one of the following values:
SW_HIDE
Hides the window and activates another window.
SW_MAXIMIZE
Maximizes the specified window.
SW_MINIMIZE
Minimizes the specified window and activates the next top-level window in the Z order.
SW_RESTORE
Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.
SW_SHOW
Activates the window and displays it in its current size and position.
SW_SHOWDEFAULT
Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application. An application should call ShowWindow with this flag to set the initial show state of its main window.
SW_SHOWMAXIMIZED
Activates the window and displays it as a maximized window.
SW_SHOWMINIMIZED
Activates the window and displays it as a minimized window.
SW_SHOWMINNOACTIVE
Displays the window as a minimized window. The active window remains active.
SW_SHOWNA
Displays the window in its current state. The active window remains active.
SW_SHOWNOACTIVATE
Displays a window in its most recent size and position. The active window remains active.
SW_SHOWNORMAL
Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
If lpFile specifies a document file, nShowCmd should be zero.
Example from AllAPi:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Send an E-Mail to the KPD-Team
ShellExecute Me.hwnd, vbNullString, "mailto:KPDTeam@Allapi.net", vbNullString, "C:\", SW_SHOWNORMAL
End Sub |
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
20-01-2004 at 12:06 PM |
|
|
yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Creating an installer..
You know, the installing/uninstalling procedure I used removes effectively some elements. I explain better.
My modules are designed to work on two different machines, but to test them I installed them both on the same machine. And of course they use many common libraries. So, when I uninstall the first module everything works, but once I run the second uninstall it requires me to insert the cd. Its a proof that some shared files have been uninstalled with the first uninstallation. But I wonder why, in that case, if I run the Uninstall function in Control Panel it doesn't require me any cd? Where did it put the temporary file to be used to uninstall? It should be an .msi file, and it'd be different by previous module's one (they have different ProductIDs) but I didn't find it in the pc. It seems somehow the first uninstall has removed the second .msi file too. I'll have to manage this sooner or later, maybe by correctly setting the SharedLegacyFile property. I'll mind it.
I saw that sample code at AllAPI, but still remain the same question: once I launched MyModule.msi, how can I programmatically detect that msiexec is not installed? And then, how can I detect neither mdac is installed?
____________________________
Real Programmer can count up to 1024 on his fingers
|
|
21-01-2004 at 03:39 PM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Creating an installer..
Try with the -x insted of -i. If you use -i, it is equal as you have started your app.msi package.
Shell SystemFolder & "\msiexec.exe /x{2E43E9EE-52C2-4B8A-8172-ED1E0C583F26}", vbNormalFocus
This code will uninstall it.
Now, for the msiexec and mdac question, i dont see the reason why do you want everything to be automatically done. Many programs have their readme.txt file tat explains what should be done if some files are not installed. But if you are determined to do it automatically, i Suggest that you search for file(s) that is installed during this two operations. If it is missing - not installed, if not, everything is fine.
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
22-01-2004 at 02:28 AM |
|
|
yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Creating an installer..
quote: Try with the -x instead of -i. If you use -i, it is equal as you have started your app.msi package.
I'll give it a tryquote: ...i dont see the reason why do you want everything to be automatically done...
The reason is that my users hardly read any ReadMe file (I included it, anyway, as you suggested), and when they do it they hardly understand what is in it. And even if they understand they are too afraid or too lazy to do everything (like most users worldwide). The result will be a phone call to me "...Setup program stops, so come here and install it!..." and I want to avoid it. (Note: I wrote my program for a club, the phone call would come in the middle of the night, while the're open )
I read somewhere that msiexec.exe/.msi files return some errors when they occur. I meant to detect these errors, but found no articles, no tutorials, no error list or usage, no stuff about it, and I don't know how to deal with them.
____________________________
Real Programmer can count up to 1024 on his fingers
|
|
22-01-2004 at 09:23 AM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Creating an installer..
Returning this topic from the archive. Why? Becasue I was playing with the VSI today and came up with some very interesting discoveries, and answers to some Yronium questions back then.
Since me and Yronium were having some discussion on how to implement installation of Windows installer engine (files that are necessary to be installed in order to recognize msi extension). WinMe,Win2K, WinXP have this engine already installed with them, Win98 doesnt (not sure of WIn98SE), so if you try to run msi setup package on brand new Win98, It will not recognize extension. I didnt know then that installing these files is possible from VSI:
Project - Properties - Build Type = Installer With WIndows INstaller Loader
....voila
Then, for all those who were wondering how to associate files with your applicaton, no need to coding it, just go to Project - Associations, and there you can set which extensions will be associated with your application.
Then, when I wanted to create Stert - Programs - MyApp folder, I was always doing it by creating a folder named Programs, then folder my App, and VSI recognized it correctly and placed it where I wanted it to be. Today I have discovered that there is a constant that serves for this matter - ProgramMenuFolder. The way to implement it would be : Add Special Folder - Custom, and then enter ProgramMenuFolder instead of NewFolder. Maybe this way there would be no troubles with different OS language verions, as Yronium pointed out.
If I came up with some new discoveries, I will post them later
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
10-05-2004 at 01:03 AM |
|
|
yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Creating an installer..
quote: Goran wrote:
.... how to implement installation of Windows installer engine (files that are necessary to be installed in order to recognize msi extension).
....installing these files is possible from VSI:
Project - Properties - Build Type = Installer With WIndows INstaller Loader
Pretty good discover. Bravo, Goran!! (applause)
quote: ....how to associate files with your applicaton, no need to coding it, just go to Project - Associations, ....
I figured it out but never tried, because I had no need yetquote: .... Add Special Folder - Custom, and then enter ProgramMenuFolder ...
I found it. The documentation speaks only about System, Windows and Programs folders, but I found some workaround on the web. And I found you can create your own folder, even under the Programs menu, by manually add a node/subnode under the StartMenu node. I referenced a Programs/MyApp folder under the StartMenu node, and put there the shortcuts. It creates the shortcuts in the right place, and doesn't overwrite the existing files/folders, like the Programs parent folder.
Regarding the main files, say DLLs, OCXs, DAO/ADO files, and so on, I suggest to check always the original position into your machine (it's a working system), and copy all the significant files into the same dir in the target machine, even if you could choose another one.quote: If I came up with some new discoveries, I will post them later
And me too, of course.
____________________________
Real Programmer can count up to 1024 on his fingers
|
|
10-05-2004 at 05:52 PM |
|
|
|
|
 |
 |