Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Publish Question

Status
Not open for further replies.

wlaflamme

Technical User
Aug 1, 2003
22
US
I have written a program that uses a com port to retrieve values from a machine to record into a database. In order to do this I have two XML files that store parameters. After installation it comes with an error that it cannot find these files. Using VB2005 Express I need to publish the program. The two questions I have are:
1.During install of my program it does not ask where I want the program installed. Can I setup the install that it loads into a certain directory? It seems to automatically send it to a folder like this ( C:\Documents and Settings\wlaflamme\Local Settings\Apps\2.0\0EMGZLYD.1OB\L6YMWJP7.W6Q\insi..tion_41fa2b4b042777a5_000c.0011_49a58c74fa82290a\ISMinitial.xml')

2. What is the best recommendation for retrieving data from files? What is the best way to include these files in the publish option? Here is generally how I retrieve the XML file.
Dim style_count, last_count, i As Integer
'StreamReader will retrieve the file from source and will convert to a stream to be processed
Dim sr As New System.IO.StreamReader("ISMinitial.xml")
'The XmlTextReader
Dim xr As New System.Xml.XmlTextReader(sr)
'The XmlDocument
Dim initialDoc As New System.Xml.XmlDocument
initialDoc.Load(xr)

Dim initialItem As System.Xml.XmlNodeList = initialDoc.SelectNodes("initial/variable")
Dim xml_gender As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("gender")
Dim xml_style As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("style")
Dim xml_style_count As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("style_count")
Dim xml_width As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("width")
Dim xml_length As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("length")
Dim xml_last As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("last")
Dim xml_last_count As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("last_count")
Dim xml_cylinder As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("cylinder")
Dim xml_delay As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("delay")
Dim xml_sample As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("sample")
Dim xml_interval As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("interval")
Dim xml_com As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("com_port")

Thanks for the help.
 
Publishing makes use of Click-Once Deployment. It's basically a lightweight and easy method to publish or install applications. It's designed to reside in the users application data folders, and the user will not need administrator privilege to install it since it's not going into Program Files. So you can't create what one would think of as a typical Windows Installation.

VB Express only allows installation via this method. You would need to purchase a real copy of Visual Studio to create normal installation packages, or use some third party installation tool.

My suggestion is the make the path to the file dynamic. My.Application.Info.DirectoryPath is a good place to start.



 
Are there any third party software that works well? The directory patyh worked very well. Thanks for the help.
 
Are there any third party software that works well

I think the relevant question is if there is any third party software which works well and is free. I have no idea on this one. If you have to end up paying for something, you might get more bang for the buck by just buying Visual Studio.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top