By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,641 Members | 1,446 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,641 IT Pros & Developers. It's quick & easy.

Generate a text/binary file during installation

P: n/a
Hi all expert,
(I got no solution on deployment group)

I would like to know how I can execute my own vb .net function during
installation.
I had created my own setup project, but i don't know how can i make a text
file included the Client's Computer Name.

Thanks alot.
Apr 3 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
jvb
To get the current computers name use
System.Windows.Forms.SystemInformation.ComputerNam e. See if the
function below helps you out.

Private Function WriteComputerName() As Boolean

Dim strWriter As IO.StreamWriter
Dim boolReturn As Boolean

Try
strWriter = New IO.StreamWriter("<FLAT FILE LOCATION>")
Catch ex As Exception
Return False
End Try

Try
strWriter.WriteLine("Computer Name: " &
System.Windows.Forms.SystemInformation.ComputerNam e)
boolReturn = True
Catch ex As Exception
strWriter.WriteLine("Unable to determine computer name: " &
Err.Description)
boolReturn = False
Finally
strWriter.Close()
End Try

Return boolReturn

End Function

Apr 3 '06 #2

P: n/a
Hi jvb,
Actually the main problem is where to put this function call to make it
work during installation when using setup project?

"jvb" <go*****@gmail.com>
???????:11*********************@j33g2000cwa.google groups.com...
To get the current computers name use
System.Windows.Forms.SystemInformation.ComputerNam e. See if the
function below helps you out.

Private Function WriteComputerName() As Boolean

Dim strWriter As IO.StreamWriter
Dim boolReturn As Boolean

Try
strWriter = New IO.StreamWriter("<FLAT FILE LOCATION>")
Catch ex As Exception
Return False
End Try

Try
strWriter.WriteLine("Computer Name: " &
System.Windows.Forms.SystemInformation.ComputerNam e)
boolReturn = True
Catch ex As Exception
strWriter.WriteLine("Unable to determine computer name: " &
Err.Description)
boolReturn = False
Finally
strWriter.Close()
End Try

Return boolReturn

End Function

Apr 3 '06 #3

P: n/a
jvb
You can place it anywhere in the install routine. I would place it at
the beginning of the project's execution so that you can have the
computer's name if the install fails.

Apr 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.