|
Your installer should not be accessing files from the folder that the .MSI was launched from. Any files it needs should be inside the .MSI itself.
Windows Installer, AFAIK, doesn't have a facility to tell the code inside an .MSI where it was launched from.
|
|
|
|
|
I beg to differ. We often use Active Directory to roll out updates and installs company-wide. It is a common requirement to pick up some client specific customisation data which they supply in an xml file accompanying the msi. When installing the same update across multiple clients it would be impractical to do a specific build for each client containing their special data to roll out to the end users.
|
|
|
|
|
Fair enough. We just never do that around here.
In our apps, we have client specific information in the users metadata in our databases. No need to send an XML file with each install.
|
|
|
|
|
I have to say the only bit we let them customise at this point is the webservice URL of their server. We said to them, just tell your end users what to type in when it is prompted on first run. Not an accepted, but as they say, 'the client is always right', at least until they pay the invoice.
|
|
|
|
|
Thankfully, just about all of my work in internal. I don't have very many clients on the outside and don't have to customize anything for a client before it goes out the door.
|
|
|
|
|
you can use the SourceDir property of the Windows Installer.
You can pass this info as a CustomAction in your deployment project : /SrcDir="[SourceDir]\"
You can then use it in c# with : this.Context.Parameters["SrcDir"]
or in vb with : Me.Context.Parameters("SrcDir")
|
|
|
|
|
Thank you very much, worked great
|
|
|
|
|
Hello people i have an ftp question in my application for employe monitoring i capture screen and then i upload it to server every 1 seccond for now i use this:
Uploader:
<br />
On Error Resume Next<br />
FileUploadedSuccessfuly = False<br />
Dim local_file As String = whatfile<br />
Dim remote_file As String = WORKSERVER & "/" & System.IO.Path.GetFileName(whatfile).ToString<br />
Dim cls_request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(remote_file), System.Net.FtpWebRequest)<br />
Dim user_name As String = "root"<br />
Dim password As String = "administrator"<br />
<br />
'Establish credentials for logging into ftp site<br />
cls_request.Credentials = New System.Net.NetworkCredential(user_name, password)<br />
<br />
'Set properties<br />
cls_request.KeepAlive = False<br />
cls_request.Proxy = Nothing<br />
cls_request.Method = System.Net.WebRequestMethods.Ftp.UploadFile<br />
cls_request.UseBinary = True<br />
<br />
'Read in the file<br />
Dim b_file() As Byte = System.IO.File.ReadAllBytes(local_file)<br />
<br />
'Upload the file<br />
<br />
Dim cls_stream As System.IO.Stream = cls_request.GetRequestStream()<br />
cls_stream.Write(b_file, 0, b_file.Length)<br />
cls_stream.Close()<br />
cls_stream.Dispose()<br />
FileUploadedSuccessfuly = True<br />
Exit Sub<br />
And Timer:
<br />
If FileUploadedSuccessfuly = True Then<br />
FileUploadedSuccessfuly = False<br />
CatchScreen()<br />
UPfile("C:\EMON\bin\tmp_" + THISPCUsername + ".jpg")<br />
End If<br />
so timer every seccond check if last file was uploaded and if it is then it grabs new picture and overwrite it and again uploading but problem is that every seccond it connects to server again from begining with pass and user name i want that it connects when i start application and stay connected and uploads same file every seccond from timer but waits until last one is uploaded successfully and if connection is droped that it reconects! thanks i tried to do that but i didnt succed for now so if u can help thanks!!!
|
|
|
|
|
First, your software is illegal if used in the United States without first warning the user you are watching them.
Second, you're design is entirely wrong for this. You're saturating the network and the FTP server with images constantly being copied to the FTP server. You're also assuming that it takes 1 second for the app to connect to the FTP server and upload the picture. This will simply not be the case all the time.
You really should be redesigning this to only capture the screens that you need to look at when you need to look at them AND not use FTP for this task. Your central monitoring app should be getting direct streams from something like VNC to minimize traffic on the network.
|
|
|
|
|
|
Member 4705584 wrote: i chose that metod becose "the boss" of company wants to check from home, office and cell phone
Just on this specification, using FTP was a poor design choice. Your implementation is MUCH slow than the "real time" provided by a VNC implementation. Also, it will only show a frame in time unless your management side implementation refreshes its image constantly.
Your design assumes that the FTP server will tolerate having a logged in connect indefinitly. You have no error checking, you're using VB6 constructs in VB.NET code, you have no methods of seeing if you actually have a good connection to the server, your code is logging into the FTP server over and over again, possibly running the FTP server out of connections. Your design also relies on a specific network configuration where you do not support proxy servers and you leave yourself open to file-based issues such as a file being written and viewed at the same time.
I can't fix this without trashing everything you have and starting over...
|
|
|
|
|
|
can annyone help me???
i need something like:
In form 1 class:
<br />
Dim FileUploadedSuccessfuly As Boolean = True<br />
Dim cls_request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(remote_file), System.Net.FtpWebRequest)<br />
Dim user_name As String = "root"<br />
Dim password As String = "administrator"<br />
cls_request.Credentials = New System.Net.NetworkCredential(user_name, password)<br />
cls_request.KeepAlive = True<br />
cls_request.Proxy = Nothing<br />
cls_request.Method = System.Net.WebRequestMethods.Ftp.UploadFile<br />
cls_request.UseBinary = True<br />
so that when form is loaded that it connects to server and stay connected
and then in timer:
<br />
If FileUploadedSuccessfuly = True Then<br />
FileUploadedSuccessfuly = False<br />
CatchScreen()<br />
Dim remote_file As String = WORKSERVER & "/" & System.IO.Path.GetFileName("C:\EMON\bin\tmp_" + THISPCUsername + ".jpg").ToString<br />
Dim cls_request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(remote_file), System.Net.FtpWebRequest)<br />
Dim b_file() As Byte = System.IO.File.ReadAllBytes("C:\EMON\bin\tmp_" + THISPCUsername + ".jpg")<br />
Dim cls_stream As System.IO.Stream = cls_request.GetRequestStream()<br />
cls_stream.Write(b_file, 0, b_file.Length)<br />
cls_stream.Close()<br />
cls_stream.Dispose()<br />
FileUploadedSuccessfuly = True<br />
End If<br />
thats all i need for now! only problem is underlined...
thx, and thanks dave , now i have to do this and then after a month or more i will go redesigning!
|
|
|
|
|
hi for all
I want use Virtual Ketboard in vb.net forms beacause my screen is touch screen
but i not found any component
please guide me
Thanks
|
|
|
|
|
If you had searched CP articles, you would have found this[^] article.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi d@nish Thank you For Your Reply
But I want This code in vb.net
if possible send me a dll file or component for this job
thanks
|
|
|
|
|
All you have to do is convert the code yourself. It's only C#, not rocket science. There are a ton of online code converters on the web. All you need to do is a simple search.
Or, you can just leave that component as is, compile it yourself, then use the resulting library in your VB.NET project.
|
|
|
|
|
As Dave said, either convert it yourself (lots of means available) or just add a reference to it in your code and use it.
You might have read "interoperability" as advantages of .Net framework, you can make use of that now.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
hi,
i would like to make a program in visual basic 9 to comunicate via Modbus with a PLC.
I alrady done one with vb6 but with vb9 (visual studio 2009) i can't.
The problem is this: when i make a string to send to PLC i send the byte as char but, when the byte is equal to "00" or to "01" the software don't send anything.
In vb6 this don't appened... some one can help me please?
Thanks
Joshua
|
|
|
|
|
Would the ASCIIencoding class help? it contains GetChar and GetBytes so using these you should be able to get anything you want to send to the PLC.
I am a bit confused by your question, as in what exactly you are trying to send out.
|
|
|
|
|
i explain better, in vb6 I send a modbus message in this way:
mscom.write("1")
mscom.write("2")
mscom.write("0")
mscom.write("0")
mscom.write("0")
mscom.write("1")
mscom.write("2F")
and all work good.
if I do the same thing in vb9 (visual studio 2009) it doesn't work.
Now it try in the way that you say
thanks
|
|
|
|
|
You shouldn't use strings when your data should be able to contain zero-valued bytes, use the Read and Write overloads that work with byte arrays. And if some of your message is text, use Encoding.GetBytes/GetString, probably for the ASCII/ANSI encoding.
|
|
|
|
|
hi
using vb, i can open a AutoCad drawing and pass few values/commands to the
autocad.This is one way communication i.e from vb to Autocad
now i need two way communication
i.e
vb to AutocAD (which i said above)
AND
AutoCad to vb
AutoCad to vb means when AutoCad Drawing is opened using vb
if user picks/select a point in Auto Cad then i want to show a vb form
is it possible
|
|
|
|
|
This depends on several things;
1) what method is being used to send the messages to Autocad, is it simply command line arguments, DDE or some other protocol
2) What does the Autocad documentation tell you? does it have any automation API's that support communication
Have you tried searching Google or the Autocad support forums?
|
|
|
|
|
hi
thanks for your reply
1)i didnt used any method till now, thats what i want to know
what method is used to show a form when user selects a point or object in Autocad.
i explain you where i stucked .....
Data i have is a autocad drawing file is stored at a place in the user system
Step1)i will open the Drawing file by using path specifed by the user
step2)the drawing file is opened using step1 and at this stage user will picks or selects a point in the drawing file then i have to show a form designed in vb
i stucked at this stage, i can open only the drawing file
is it possible with vb.net or vb or vba
i searched in google and found few articles , i followed them but i could not achevied it
|
|
|
|