|
I am just trying to get the version value from a manifest file that was created by a build/compile. The file can be found in any applications \bin\Release\ServiceInvoice.exe.manifest folder. I am writing my own Application updater. I want my apps to be under easily accessible under the 'program files' directory so click-once publish is not an option. I have written a small routine that downloads the manifest from my \bin\Release folder (which is a virtual dir under my IIS) and then extracts the version via the routine (GetManifestVer) that we are discussing. compares it with its own version and makes a decision to download the 'exe' or not. Enclosed is the code, it is very raw and once working I will stick in more parameters and error trapping before it is done. But it will go something like this .
Private Sub UpdateApp()
Dim MVer As String = ""
Dim AVer() As String = Split(My.Application.Info.Version.ToString, ".", True)
Dim AName As String = My.Application.Info.AssemblyName
Dim LocalPath As String = My.Application.Info.DirectoryPath
Dim LocalApp As String = LocalPath & "\" & AName & ".exe"
Dim RemoteApp As String = "http://Stu-Laptop/IMS/" & AName & "/" & AName & ".exe"
Dim RemoteManifestFile As String = "http://Stu-Laptop/IMS/" & AName & "/" & AName & ".exe.manifest"
Dim LocalManifestFile As String = My.Application.Info.DirectoryPath & "\Manifest.xml"
Dim xmlr As XmlTextReader
Dim WebConnection As New WebClient()
Dim CurV() As String
Try
If File.Exists(LocalManifestFile) Then File.Delete(LocalManifestFile)
WebConnection.DownloadFile(RemoteManifestFile, LocalManifestFile)
Catch ex As Exception
MsgBox("Error retrieving web file", ex.Message)
Exit Sub
End Try
xmlr = New XmlTextReader(LocalManifestFile)
While Not xmlr.EOF
xmlr.Read()
If xmlr.Name = "entryPoint" Then
If xmlr.IsStartElement Then
MVer = xmlr.GetAttribute("version")
Exit While
End If
End If
End While
xmlr.Close()
If File.Exists(LocalManifestFile) Then File.Delete(LocalManifestFile)
If MVer = "" Then Exit Sub
CurV = Split(MVer, ".", True)
If (AVer(0) < CurV(0)) Or (AVer(1) < CurV(1)) Or (AVer(2) < CurV(2)) Or (AVer(3) < CurV(3)) Then
FileCopy(LocalApp, LocalPath & "\" & AName & ".old")
WebConnection.DownloadFile(RemoteApp, LocalApp)
System.Diagnostics.Process.Start(LocalApp)
End If
End Sub
Thanks again for your continued interest. Stu
|
|
|
|
|
I just opened up a few of these manifest files (with PSPad) and they all look something like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Neither the ones made with VS 2003 nor the ones made with VS 2008 had any mention of a tag or attribute called "entryPoint", they do however all have the tag "assemblyIdentity" with a "version" attribute.
Is it possible that the manifest file you used (late the day-before-yesterday) is/was for some reason different from the average manifest file ?
As the problem seems to be that the element "entryPoint" is simply not found, perhaps you should try to open your manifest with some editor, and see if there isn't some other element you could check for?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Yes my manifests seen a little more complicated. But I am glad to inform you that I have resolved the issue. Like usual it was me. When you work very late into the night strange things happen, specially when there is a full moon. I usually quit when the computer gives a loud beep in response to some error & it scares me out of my chair mumbling something like 'What the *)%(&^^ was that?'. below is a piece of my manifest.
<asmv1:assembly manifestversion="1.0" xsi:schemalocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1">
<asmv1:assemblyidentity version="1.0.0.19" name="ServiceInvoice.exe" publickeytoken="0000000000000000" language="neutral" processorarchitecture="msil" type="win32">
<application>
<entrypoint>
<assemblyidentity name="ServiceInvoice" version="1.0.41220.731" publickeytoken="D1E735326A597357" language="neutral" processorarchitecture="msil">
<commandline file="ServiceInvoice.exe" parameters="">
<trustinfo> <security>
<applicationrequestminimum>
<permissionset unrestricted="true" id="Custom" samesite="site">
<defaultassemblyrequest permissionsetreference="Custom">
Its a pretty long manifest - would take 2 to 3 pages to print out. The correct node to search for is assemblyIdentity not entry point. Both my raw code and your error trapped code works correctly when given the right value. I have finished my routines and it works like a dream, a seamless, silent, transparent check of the version & then download if necessary of a new exe and kick off. User never sees a thing. It reverts back to the old exe if it fails at any point. Its nice now, all I have to do is compile, nothing else is required, I don't have to make any files set any flags etc.
I do have another issue though. It seems like I got myself into some kind of debug/Edit purgatory where I can't edit in the debug mode. It started when I put some values in the debug properties window for testing my command line functions. I get cute little padlocks on my code page tab and a error that says 'Changes are not allowed when the debugger has been attached to an already running process or the code being debugged has been optimized at build or run time' a search of the net and trying other peoples workarounds have not resolved it and its really starting to piss me off. Oh well, being of German heritage, I am stubborn and as tenacious as a rabid pit bull and sure that I will figure it out even if I have to trash & rebuild the project (none of my other apps are doing it). If you are familiar with this particular animal, then drop me a line.
Thanks again for all of the time you have spent and interest shown. You are the first guy that has ever responded to an issue that I have posted (I don't post often) and it is appreciated.
|
|
|
|
|
It seems that I need quotes around the XML. Let me try that again.
"'<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1">
<asmv1:assemblyIdentity version="1.0.0.19" name="ServiceInvoice.exe" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<application />
<entryPoint>
<assemblyIdentity name="ServiceInvoice" version="1.0.41220.731" publicKeyToken="D1E735326A597357" language="neutral" processorArchitecture="msil" />
<commandLine file="ServiceInvoice.exe" parameters="" />
</entryPoint>
<trustInfo>
<security>
<applicationRequestMinimum>
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>'"
|
|
|
|
|
You should also considering laying off the late night coding parties, and get yourself some good old fashion sex, drugs and rock 'n roll... and if you feel you must, some sleep.
My advice is free, and you may get what you paid for.
|
|
|
|
|
You got that right, but unfortunately those days are gone, over here in the US, unemployment is running rampant. The programming field has been decimated by outsourcing. H1 Visa's get what jobs are left. The government has declared war on the citizens, stealing everything we got & giving it away to their cronies who will give some of it back to them by way of speaker fees, campaign contributions, and graft of all sorts. Our Constitution has been totally trashed by an imaginary war on terror as if we didn't know who is really behind it. Sex?, Drugs?, Rock & Roll?, Sleep? All of those things a dim memory of days long gone. Hope things are better where your at. Enjoy it while you can. The New World Order is comming....
Thanks again for your support Stu.
"Truth is treason in the Empire of Lies."
|
|
|
|
|
Can any one tell me how to make delegates in multithreading
for grid view or a control having parameters in its property
Best Of regards,
Mirza Rahman
|
|
|
|
|
softdev_sup wrote: a control having parameters in its property
How do you mean ?
Delegates will work in a multi threaded environment.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
like below code how can i create delegate for Grid View Control Property like
grid.item(col,row).value=AAA
Delegate Sub SetTextCallback(ByVal [text] As String)
Private Sub SetText(ByVal [text] As String)
If Me.TextBox1.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf SetText)
Me.Invoke(d, New Object() {[text]})
Else
Me.TextBox1.Text = [text]
End If
End Sub
Best of Regards
Mirza Rahman
|
|
|
|
|
Hi
I would like to populate data from a database into a treeview in vb6.0 application.
I have a table in this format
Child Parent 1st Level 2nd Level 3rd Level
50000011 50014561 GB_3623 GB_3440
50000012 50000012 GB_3908 GB_5000
50000012 50000012 GB_3908 GB_5000
50000013 50026347
50000014 50010875 GB_6135 GB_5000
50000015 50010414
50000017 50000017 GB_3922 GB_3900 GB_5000
50000018 50000018 GB_3220
50000018 50000018 GB_3220
50000019 50010473 GB_3440
50000019 50010473 GB_3440
etc
etc
etc.
Now from this table to my vb6 form
3rd Level is GreatGreatGrandparent,
2nd Level is GreatGrandparent,
1st Level is Grandparent,
Parent is parent
& Child is is child
I want to represent this in a tree view control in vb6.0 and when I search from my form for any of the five fields mentioned above, the treeview should highlight that particular node and set the expanders on that particular hierarchy.
I am not familiar with treeview control at all. Can someone help me please?
Yours desperately ,
Kumar.
|
|
|
|
|
Why on earth are you writing code in VB6 ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello everyone.
I am using Crystal Report with vb.net 2005,... i have a query(using query builder) which joins two table and gets some record depending on the foreign key...it works fine in data grid and other query design...But in crystal report viewer, some data are getting repeated.....
Could anyone please tell me why is that strange behavior of CR? Is it a problem with my query?
Thank You in advance,
Himangshu S
I am a learner Always
|
|
|
|
|
can you post your query so i rectify the problem?
also how can you supply data to crystal report(run time or design time)?
|
|
|
|
|
thanks for your reply,
Sorry...the query is not with me right now..I will post it by tomorrow for sure...
But for the time being let me explain you, What I have done is....
create a new crystal report, with the wizard option select ms Access data and select fields and all from both the table...than in a separate from which has cr viewer and a button with a combo box....I select the id in the combo box and press the (refresh) button where I have written code(with the querry) to retrieve the records and put it to the cr viewer....that's how I did it...
Could you please tell me what can go wrong
Regards,
Himangshu
I am a learner Always
|
|
|
|
|
try following
make a query in MSAccess database which contains all fields of both table.Now go to following steps
1. select Data menu item
2. select Add new Data Source
3. select appropriate database and then select query
above three steps generate a dataset say dataset1
Now open your crystal report and perform following steps
1. From field explorer, right click on Database Fields and select Database Expert. This open a window
2. go Project Data-->ADO.Net dataset--->select the dataset (in this case select dataset1)
3. select this dataset and click on Ok button
Now this dataset show all fields of both tables in field explorer.Place required fields on report
Now on the form which have crystalReportViewer,combo and button, place following code to click event of button
Dim ob As New report1'( report1 is your crystal report)<br />
'here populate dataset(ds) for selected id <br />
ob.SetDataSource(ds.Tables(0))<br />
CrystalReportViewer1.ReportSource = ob<br />
CrystalReportViewer1.Refresh()
hope this helps
|
|
|
|
|
thanks,
But my data retrieval should happen dynamically....More over I am deploying the project.....In that case will it create any problem,since I want it to be dynamic..
I am a learner Always
|
|
|
|
|
himangshuS wrote: But my data retrieval should happen dynamically..
yaa.For design crystal report, you must have some structure of table or query so i suggest to create data source from data menu.
i also mention in previous post that how can you supplied data at run time(see lower section of my previos post)
himangshuS wrote: More over I am deploying the project.....In that case will it create any problem,since I want it to be dynamic..
add prerequistie "Crystal report for .Net framework 2.0" from Menu Project--->Project Properties--->Publish
|
|
|
|
|
yes even i am having the same exact problem,
but we dont want to use the dataset concept because we are selecting the database when creating this which will not be in the same path while we are deploying the project the database may be saved in a different location
|
|
|
|
|
I'm trying to make a project in vb6 that i need to list all the files when a open any folder?
Please help me.
|
|
|
|
|
|
Hi,
I am using vb.net with VS2008. I tried to change the font of the Form. However, I was not able to change the script of the font to "central european" in the font dialog. When I re-open the font dialog, it still show the "Turkish" instead of "Central European".
If you have any idea how to change the font and the font script for a specific control in the form, Would you please let me know.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Dim family_name As String = "YourFontNameHere"
Dim font_size As Single = 10
Dim font_style As FontStyle = FontStyle.Bold Or Or FontStyle.Italic Or FontStyle.Underline Or FontStyle.Strikeout
Dim MyFont As New Font(family_name, font_size, font_style)
Me.Font = MyFont
|
|
|
|
|
Hi,
I am developing desktop application in vb.net using .netframework 2.0.
In this development I am using one DLL which was developed in .netframework1.1. All of sudden i am getting the message as "The Specified module could not found.( Exception from HRESULT" when i trying to run the DLL related code.
The same code it is working in other mahines.I have same .netframeworks compares to other computers which were application running sucessfully.
Even I did repair of visiual studio 2005 but no use.
Please let me know any thoughts on this problem
Regards,
Santhosh
|
|
|
|
|
I have been programming with VB6 for many years and I am now in the process of “upgrading” to VB2008. I want to do all my work with code and not with data controls. (See my attached code so far). This is a useless sample just to get my head around a few things.
1. In the scores group on my form, I have 3 textboxes binded to my “BindingManagerBase” I can now move up and done both tables. I want to add “Delete”, “Add” and “Edit” functionality for the Scores table. Instead of manually looking up the StudentID, I want to replace the textbox with a Combobox. So I want to see the student’s “FirstName” from the students table in the combo box, and then link the StudentID from the Student Table to the StudentID in the TestScores table. (I have done it many times with VB6, but how do I do it in VB2008.
This is my tables and my code.
Table Name: Students
StudentID FirstName LastName
1 Amy Anderson
2 Bob Baker
3 Cindy Carter
4 Donald Dorph
Table Name: TestScores
StudentID TestNumber Score
1 1 98
1 2 94
2 1 74
3 2 65
' Data adapter for the Students table.
Dim m_daStudents As New OleDbDataAdapter( _
"SELECT Students.StudentID, Students.FirstName, Students.LastName " & _
"FROM Students", _
"PROVIDER=MSDataShape;" & _
"Data PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source='Student Scores.mdb';" & _
"Persist Security " & _
"Info=False")
' Data adapter for the TestScores table.
Dim m_daTestScores As New OleDbDataAdapter( _
"SELECT TestScores.StudentID, TestScores.TestNumber, TestScores.Score " & _
"FROM TestScores", _
"PROVIDER=MSDataShape;" & _
"Data PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source='Student Scores.mdb';" & _
"Persist Security " & _
"Info=False")
' The DataSet.
Dim m_DataSet As New DataSet("Student Scores")
' Declare a binding manager field
Public bm_Students As BindingManagerBase
Public bm_TestScores As BindingManagerBase
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Load the Students table.
m_daStudents.Fill(m_DataSet, "Students")
' Load the TestScores table.
m_daTestScores.Fill(m_DataSet, "TestScores")
' Get the DataTable objects.
Dim dt_students As DataTable = m_DataSet.Tables("Students")
Dim dt_testscores As DataTable = m_DataSet.Tables("TestScores")
' Get DataColumn objects we will need.
Dim col_students_studentid As DataColumn = _
dt_students.Columns("StudentId")
Dim col_testscores_studentid As DataColumn = _
dt_testscores.Columns("StudentId")
Dim col_testscores_testnumber As DataColumn = _
dt_testscores.Columns("TestNumber")
' Define the primary keys.
Dim students_keys() As DataColumn = _
{col_students_studentid}
dt_students.PrimaryKey = students_keys
Dim testscores_keys() As DataColumn = _
{col_testscores_studentid, col_testscores_testnumber}
dt_testscores.PrimaryKey = testscores_keys
' Make a foreign key constraint.
Dim fk_studentid As New ForeignKeyConstraint( _
col_students_studentid, col_testscores_studentid)
dt_testscores.Constraints.Add(fk_studentid)
' Bind to textboxes for Students table
txtStudentID.DataBindings.Add("text", m_DataSet, "Students.StudentID")
txtFirstName.DataBindings.Add("text", m_DataSet, "Students.FirstName")
txtLastName.DataBindings.Add("text", m_DataSet, "Students.LastName")
' Bind to textboxes for TestScore table
txtTestScores1.DataBindings.Add("text", m_DataSet, "TestScores.StudentID")
txtTestScores2.DataBindings.Add("text", m_DataSet, "TestScores.TestNumber")
txtTestScores3.DataBindings.Add("text", m_DataSet, "TestScores.Score")
' Bind to datagrid for TestScore table
DataGridView1.DataSource = m_DataSet
DataGridView1.DataMember = "TestScores"
bm_Students = BindingContext(m_DataSet, "Students")
bm_Students.Position = 0
bm_TestScores = BindingContext(m_DataSet, "TestScores")
bm_TestScores.Position = 0
End Sub
|
|
|
|
|
Have you tried binding the combobox to the datatable?
i.e.
ComboBox.DisplayMember = FieldToDisplay
ComboBox.ValueMember = ValueField
ComboBox.DataSource = DataTable
|
|
|
|
|