|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Generate a text/binary file during installationHi 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. To get the current computers name use
System.Windows.Forms.SystemInformation.ComputerName. 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.ComputerName) 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 Hi jvb,
Actually the main problem is where to put this function call to make it work during installation when using setup project? "jvb" <gome***@gmail.com> ???????:1144074172.059946.57***@j33g2000cwa.googlegroups.com...Show quoteHide quote > To get the current computers name use > System.Windows.Forms.SystemInformation.ComputerName. 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.ComputerName) > 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 > 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.
Trying to "display" control characters in a text box
Unique Machine Identifier Have you upgraded to VS 2005? Getting the selected item from a listview Foreign Language Names WMI script to get Win32_Product Where to do the Loading tasks for application ? Joining files error line number Typed Dataset and Numeric Only Fields in VB.Net 2005 ? |
|||||||||||||||||||||||