|
Jon_Boy wrote: Obviously network shares are not supported from the command line,
What do you mean?? Are you saying that you can't launch an .EXE from the command line when the .EXE resides in a share. Of course you can, so long as the machine trusts the network location. By default, .NET will not run code from a non-local source.
I guess I'm not completely understanding your environment or your app's setup.
|
|
|
|
|
Ok, I'll try more examples here...
For ClickOnce deployment, lets say you want to test the network publishing functionality (not the web site deployment). You need to create a directory to push the published files to and then that directory needs to be shared. For example: create directory C:\DeployTesting and give it a public share of \\WorkstationName\DeployTesting.
ClickOnce can then deploy the each published version successfully. You will be able to run the app fine and pick up updates from the start menu program link. Everything to this point is fine.
I can manually start the app from the command line using the "C:\Documents and Settings\User\Start Menu\Programs\Company\DeployTesting\App1.appref-ms".
Unless I am mistaken, you can't start the app via the UNC path, because you can't access the network share name from the command line (IE: \\Workstatuion1\DeployTesting\App1.application). From what I can gather, the arg passing is only supported via the web since they are passed in the URL path.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Jon_Boy wrote: Unless I am mistaken, you can't start the app via the UNC path, because you can't access the network share name from the command line
Try the CreateProces API, I think that DOS just doesn't like the UNC-path. You could also try mapping your path to a drive-letter
I are troll
|
|
|
|
|
Eddy Vluggen wrote: Try the CreateProces API, I think that DOS just doesn't like the UNC-path. You could also try mapping your path to a drive-letter Smile
Tru-dat! Process can be started, but can't pass args like this: "http://clickonce.thing.com/shell.application?p1=this&p2=that"
I've tried diff. combos of passing in args like ?this, ?p1=this, this, etc - no go.
Sigh.
Maybe the next version of VS will have better support on the ClickOnce stuff (regarding passing args and allowing for single file updating, etc).
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Are you trying to launch it local, or through a webbrowser? I was under the assumption that you are trying to run an executable located on the path "\\Workstatuion1\DeployTesting\App1.application".
The way you're putting it now makes wonder whether you are trying to pass arguments to the installer-application?
I are troll
|
|
|
|
|
Eddy Vluggen wrote: Are you trying to launch it local, or through a webbrowser? I was under the assumption that you are trying to run an executable located on the path "\\Workstatuion1\DeployTesting\App1.application".
Yes - networkable paths, but clickonce allows for passing arguments via a URL only (at least through my research).
The setting for passing args is called "Allow URL parameters to be passed to application". All the examples I have found reflect that.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I didn't know that, just bookmarked the thread as a future reference
I is learning
|
|
|
|
|
If in my application I have an ID of an object (GUID) and this ID could belong to one of three different types of object, what is the best way to determine which object the ID belongs to?
Let me explain a little more. I have 3 classes which inherit from the same super class. Any instance of these three classes can be the owner of a service. Given the service, which has an owner ID, what is the best way to determine the owner? i.e. what type of object.
I have some ideas but each one seems to have it's flaws. I thought of having 3 fields in the database table for owner instead of one, one for each type of object but surely this goes against good database design. I thought of having, in the database table, an owner field and an owner type field (this seems the best way so far). Or, in my aplication, try to instantiate each class using the ID, the one that works wins! But this doesn't seem very efficient at all!
Any advice is appreciated. Thanks.
|
|
|
|
|
The best way (given the limited explanation you have), would be a lookup table. Store the ID and the object it belongs to, or the object type, in some structure. Trying to create an object to "see if it works" is probably the worst way you can go about this.
|
|
|
|
|
OK great, thanks for your help.
|
|
|
|
|
Liqz wrote: I thought of having, in the database table, an owner (ID?) field and an owner type field (this seems the best way so far).
You thought correctly, it enables you to lookup the type based on the OwnerID without storing duplicates
It is dangerous to instantiate something that you do not know - since it might, for example, delete all records in a table on startup, as initialization. Even if you're sure that nothing can go wrong, then it would still be slow, as you already stated.
Liqz wrote: what is the best way to determine the owner? i.e. what type of object.
If you can't ask the owner-object itself, then you'll have to resort to keeping track of that information elsewhere. Like tracking it in a database
I are troll
|
|
|
|
|
Hi guys....
i have tried many ways to do this and have googled and searched msdn but to no avail.
i want my client app.exe to check app.exe on the server.
if the server app.exe is of a new version then the client app.exe to copy and overwrite itself.
the reason for this is i have many client pc's at a site.
i simply want to drop the latest app.exe on the server and whenever a client app.exe is launched then it should do the above check.thus the client app.exe is always the latest app.
this is my code below.
Dim objFSO As New Object
Dim objLocalFile, objServerFile As New Object
Dim dtmLocalDate, dtmServerDate As New Object
Const OverwriteExisting = True
'COPY FILE
objFSO = CreateObject("Scripting.FileSystemObject")
objLocalFile = objFSO.GetFile(My.Settings.LocalFile.ToString.Trim)
dtmLocalDate = objLocalFile.DateLastModified
objServerFile = objFSO.GetFile(My.Settings.ServerFile.ToString.Trim)
dtmServerDate = objServerFile.DateLastModified
If dtmLocalDate > dtmServerDate Then
objFSO.CopyFile(objServerFile.Path, objLocalFile.Path, OverwriteExisting)
'OR
'My.Computer.Network.DownloadFile("\\Server\app.exe", "C:\client\app.exe", "domain\username", "Password", True, 10000, True)
End If
the error i get is....
"The system detected a possible attempt to compromise security. Please ensure that you can contact you server that authenticated you."
thanks
Anoop
|
|
|
|
|
You need to write a seperate app that does the check and downloads a new .EXE. You cannot overwrite an .EXE that's already running, so it has to be done by a seperate app.
And why on earth are you using the FileSystemObject when all of it's functionality and WAY MORE, can be found in the System.Io namespace in the .NET Framework??
|
|
|
|
|
hi,
using FileSystemObject cos i was not able to download the file usind my.computer.network.download.
i was just trying different options.
yes,
i have created a seperate app to check both versions before overwrite, however im still getting the same error, with network authentication.
thanks
|
|
|
|
|
I have no idea what's going wrong with your setup. The original code you had does work, so it's got to be something in your network's setup that you don't know about that's causing the failure. I already told you how to specify the username with the domain the user account is in, so there's something else you have to talk to your network people about to get the answer. What's causing the problem is specific to your network environment.
|
|
|
|
|
|
hi...
modified 28-Nov-12 8:34am.
|
|
|
|
|
Hi,
this smay help
Dim objFSO, objFile, objDoc, PrevLine, CurrLine, lp
objFSO = CreateObject("Scripting.FileSystemObject")
objFile = objFSO.OpenTextFile("C:\Stock.txt", 1)
PrevLine = ""
lp = 0
'open the textfile
Do Until objFile.AtEndOfStream
'read the line
objDoc = objFile.ReadLine
'store the 1st line in a temp var
CurrLine = objDoc
'skip the 1st entry
'insert your code here that does the comparison, dfn and baloon
If ((CurrLine <> PrevLine) And lp &<> 0) Then
'write your output here
MsgBox(CurrLine)
End If
'increment the line counter
lp += 1
'make the 2nd var = 1st var line
PrevLine = CurrLine
Loop
objFile.Close()
hope this helps
thanks anoop
|
|
|
|
|
|
Hi
you need to update the variable currentpart,dfn,baloon to the nextpart,dfn,baloon when completed the comparison.
If ((currentLine <> previousLine) And (count <> 0)) Then
If (NextPart = currentPart And currentDNF = NextDNF And currentBaloon = NextBaloon) Then
sw.WriteLine(currentPart & count)
End If
End If
currentpart = nextpart
currentdfn = nextdfn
currentbaloon = nexboloon
count = count + 1
hope this helps
|
|
|
|
|
Do While currentPart = name
temp = sa.ReadLine()
name = temp.Substring(0, pF(1))
error on line "name"
the reference to the object does not have an instance of that object...
I you see my first Meaasge, you will find these lines...
Not sure about the error message
|
|
|
|
|
I have an oddity.
In Excel VBA I can access the content of a ComboBox as sDataExample = ComboBox1.Value having typed sDataExample as a string, and that is good.
IN VB I am trying to assign the selected item in the combobox to a string.
sDataExample = ComboBox.ValueMember() and it is not returning a string to sDataExample.
(It appears to be null).
How do I get the selected ComboBox Item into sDataExample as a string?
------------------------------------
"I am always serious about what I do, not necessarily about how I do it."
Tom Baker
|
|
|
|
|
ComboBox.Text should do it if your combo box is populated with strings.
ValueMember() is used when binding data to the combo box, it specifies what property to use as the value of the combo box item.
|
|
|
|
|
Hot Dammit!
Of Course!
I had a brain malfunction.
Thanks.
------------------------------------
"I am always serious about what I do, not necessarily about how I do it."
Tom Baker
|
|
|
|
|
There is method to read grayscale image as a 2 dimensional matrix in VB?
|
|
|
|
|