Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Setup / May 2008

Tip: Looking for answers? Try searching our database.

using a windows form as Custom Action in a Setup Project

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jassen Cali - 01 Apr 2008 09:24 GMT
I'm really in a bind and I hope there's somebody who can direct me to a clear
answer..

I'm creating an MSI Installer for our system.. before it installs the
program.. It must check :
1. the server exists (for installation on a specific server)
2. if the username and password of the user exists on the server
3. if the database already exists
4. if the connection to the server exists
has 3 buttons :
1. check connection
2. run the script for all the required DBs
3. check if the DB exists
has textboxes for:
1. username
2. password
3. combo box for server list
4. database names
5. path or destination of installation

all these are required by the client.. so I really can't change that.. I
tried using the custom UI windows but none come close to that or it isn't
customizable... so I created a windows form and added it as a custom action
to the MSI Installer.

Everything worked out fine.. until... it just hit me.. what if the user
didn't want to continue the installation? since the windows form is just a
custom action.. when the exit/close buttons are clicked the installation
still continues... How do you cancel or do a rollback do all the transaction
up until that part of the installation? I'm lost.. and I know that I should
probably search for the answer.. I am.. and have been doing so for almost a
week and still continuing to do so.. please could anybody help?
Phil Wilson - 01 Apr 2008 19:45 GMT
Visual Studio doesn't support custom actions in the standard UI sequence, so
you can't verify input there. You have to do verification after all the
files are installed and roll back, and you do this in an installer class by
throwing an InstallException.
Signature

Phil Wilson
[MVP Windows Installer]

> I'm really in a bind and I hope there's somebody who can direct me to a
> clear
[quoted text clipped - 33 lines]
> a
> week and still continuing to do so.. please could anybody help?
Jassen Cali - 03 Apr 2008 08:23 GMT
thanks, that really helped a lot. I'm not really sure whether or not I'm
doing the right thing but to my judgement the solution I did is the nearest
thing that could match the requirements... but there seems to be a new
problem... and by the way I'm using Visual C# Express Edition (don't bother
asking me why...)

What I did:
created a windows form application added all the necessary textboxes,
buttons, Folder Browser Dialogs, combo boxes...
created a class in the windows form application that inherits the Installer
class(based on what you said..thanks)
created another class to act as a global variable to pass values between the
installer class and the windows form application
created the Setup Project in Visual Studio 2005....
added the windowsform application... so on and so forth..

now the problem is... all my folder browser dialogs only have the buttons
and everything else is a blank... and one important thing to mention is that
I had to remove the [STAThread] from the windows form application so that the
installation stops to continue.. I really don't know why it can't render the
folder browser dialog and yet it renders everything else with no problem. I
also tried running the windows form application by itself... it works just
fine..

> Visual Studio doesn't support custom actions in the standard UI sequence, so
> you can't verify input there. You have to do verification after all the
> files are installed and roll back, and you do this in an installer class by
> throwing an InstallException.
Phil Wilson - 03 Apr 2008 19:19 GMT
Unfortunately there's a black hole in this area. The MSI architecture has a
UI stage up front where data is gathered and an execute stage where the
system is updated. The MSI architecture doesn't expect UI to be shown in
this phase, and doesn't play well with Windows message pumps running in an
msiexec process that may be impersonating the installing user with limited
privileges or running with the SYSTEM account.  Add to this that the MSI
team doesn't support installer class custom actions, and you get this
confusion.

Signature

Phil Wilson
Definitive Guide to Windoows Installer
http://www.apress.com/book/view/1590592972

> thanks, that really helped a lot. I'm not really sure whether or not I'm
> doing the right thing but to my judgement the solution I did is the
[quoted text clipped - 34 lines]
>> by
>> throwing an InstallException.
Jeffrey - 06 May 2008 09:57 GMT
hi,
i don't understand how i can exit my installer class on clicking
Cancel_Button?
I need to know when it's clicking to execute "rollback".
thanks.

> Visual Studio doesn't support custom actions in the standard UI sequence, so
> you can't verify input there. You have to do verification after all the
[quoted text clipped - 37 lines]
> > a
> > week and still continuing to do so.. please could anybody help?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.