Getting Empty String

Y

Yoshitha

Hi

I am working on a web project.

I have a InstallerClass in my project.

While making setup ( using web setup template) for this web application, I
have added a userinterface with 4 textboxs, and added assembly to
CustomActions-->Install

In the installer class I have the following code




Public Overrides Sub Install(ByVal stateSaver As
System.Collections.IDictionary)

MyBase.Install(stateSaver)

Dim SName, Uname, PWD, DName As String

SName = Trim(Me.Context.Parameters.Item("ServerName"))
Uname = Trim(Me.Context.Parameters.Item("UserName"))
PWD = Trim(Me.Context.Parameters.Item("Password"))
DName = Trim(Me.Context.Parameters.Item("DatabaseName"))

If Trim(SName) = "" Then
Throw New InstallException("No arguments specified for
ServerName")
End If
If Trim(Uname) = "" Then
Throw New InstallException("No arguments specified for
UserName")
End If
If Trim(DName) = "" Then
Throw New InstallException("No arguments specified for
DatabaseName")
End If

Dim strConnStr As String = "server=" & SName & ";uid=" & Uname &
";pwd=" & PWD & ";database=" & DName & ";"

' rest of the code will copy this strConnStr to web.config



End Sub


In the above code I am getting emptystrings in SName,UName,PWD,DName etc....

It is sure that This code getting invoked while installing the
webapplication.

But I am getting empty string for
Me.Context.Parameters.Item("ServerName")

So Please help me in this regard.

Thanx in advance
Yoshitha
 
J

Jan

In the Custom Actions Arguments fill in
/SName=[ServerName] /UName=[UserName] etc...

the first name will be the name that appears in the Dictionary Passed
to your installer
the second name will be the name you gave the Textbox in the installer
Dialogs section

Jan
 
Y

Yoshitha

Hi

Jan Thanks for your help..Its working..

Also for the same web application, I need to run an exe while installation
process is going on...
How can I do this?

please help me in this regard.
 
J

Jan

Add another custom action for the same target and set 'InstallerClass'
to false and it will execute the target if it's an exe. If it's a dll
you need to write a host.


Jan
 
Y

Yoshitha

Hi

Jan Thanks ... it is working
But after geting invoked EXE, when I click "Close" button the following of
that EXE the following message is coming
"There is a problem with this Windows Installer Package. A program run as
part of the setup did not finish as expected. Contact your support personnel
or package vendor."
What could be the reason for this? I just creatd one more custom action for
the EXE and put 'false' for the InstallerClass section.
Is anything more to do?

Also for an application I am getting the error like as follows

The Installer is having a user interface with 4 textboxes.
Let 'XXX' is the value of the 4th textbox.
While installer runs, first interface will come and next a screen which
allows to specify VirtualDirectory will come. When I click 'Next' in that
screen, it is halting for 4 to 5 seconds and giving the following message
"The specified path 'XXX' is unavailable"


Thanks for your time and concern.


regards
Yoshitha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top