|
countered downvote
|
|
|
|
|
|
|
Hi,
I have to create a single setup package which on detection of User's machine decides which msi to consider(compiled for x86 bit machine or x64 bit machine).
My Project using:
1. Visual Studio 2010
2. Coded in C#
3. Built on framework 4.0
4. Using Windows Installer 4.0
5. Prerequisits included (Framework 4.0 (integrated x86 & x64) and SQL Express2008 (integrated x86 & x64))
Problem is currently i have to build 2 setups for different target palteforms (x86 & x64) which bundeling same prerequist files.
If a single setup can be done which decides which sub-msi to use will save more that 100 mb of files to be included in the package.
Thus i want to create one setup.exe, one set of prerequisites and two msis' in separate folders (e.g. x86 & x64) which contains their respective msi file.
So that executing setup.exe will search for firstly prerequisites & then on the basis of system will run the appropriate msi to install.
Regards,
honeyashu
modified 25-Oct-12 5:26am.
|
|
|
|
|
I don't think that is possible, every app I have downloaded that has a different requirement for 86/64 has supplied separate MSIs.
I would be mightily annoyed if I had to download x86 files when installing on a 64 machine!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for your reply, but what i want is i want to create one setup.exe, one set of prerequisites and two msis' in separate folders (e.g. x86 & x64) which contains their respective msi file.
Thus running on setup.exe will search for firstly prerequisites & then on the basis of system will run the appropriate msi to install.
Regards,
Ashish
|
|
|
|
|
OK, so what's the problem then??
Other than, yes it's possible. Setup.exe wrapped installers like this are made all the time.
BTW: Your pre-req's, depending on what they are and how your application uses them, would possibly ALSO have to be seperated into x86 and x64 versions. You cannot mix 32 and 64-bit code in the same process, so if your app is running 64-bit, it cannot use a 32-bit library.
|
|
|
|
|
Problem is i am unable to find a way to create such type of setup.exe
which should call appropriate msi to run on correct system.
|
|
|
|
|
You can create the Setup.exe in any language you want. C and C++ won't require you to install a prereq just to run the Setup.exe. You could use C# or VB.NET, but the user would have to install the .NET Framework on the machine first (if needed) before the user launches your Setup.exe.
In any case, all your Setup.exe is doing is determining which bitness of Windows it's running on then starting a new Process with the appropriate command line to launch your installer, such as "msiexec /i myinstall.msi" and waiting for it to end.
|
|
|
|
|
I don't think it can be done with an MSI installer. You need to have two projects which build two versions of the .msi and which you both provide for download to the user.
You could write a tiny application that checks the platform, downloads the appropriate MSI and uses Process.Start to run it. Most applications don't bother with this, they expect users to know which platform they're on.
|
|
|
|
|
Hello Community,
I am fairly new to OOP so forgive me in my faltering.
I'm putting together a rather small application, in WPF .NET4CP. This application will fetch information from a SQL server and should display the results.
In this example the SQL DB's table will contain lets say 5 columns (first name, last name, description, job, access). These are all varchar.
When the query is run from a button onclick, each resulting row's field will need to be mapped to a control (like a label or something simple). Here's what I do not understand - how does one dynamically create instances of controls AND handle where they will be shown/placed/located in the application (these controls may not all be grouped together in the same place - a tabular listing of results wouldn't do me much good).
I seriously wouldn't want to define an int for say a Y axis value, and for each result, create a new instance of a control, set Y axis to int and then increment int +=10; and go to next result right?
I'm missing fundamentals here and I'm frustrated that I'm not sure what the proper terminology is or how to search for answers.
modified 25-Oct-12 12:03pm.
|
|
|
|
|
The most common design for this type of data is to use a grid to list the records and a panel/dialog/form to display the detail.
There is nothing dynamic about the UI, especially with WPF/Silverlight, you should know what the columns are and can therefore name the grid columns and the form controls.
As you have all the information you then design the view placing the controls where you want them.
The grid should be bound to a collection and there should be a selecteditem bound to the grid and the form controls.
I suggest you get a book on WPF and work through some examples you do not have a grasp of the fundamentals yet.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
In addition to Mycroft's comments I would mention that there is also a Silverlight WPF forum[^], which may be a better place for future questions.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
This sounds like it can be done with a ListBox or something similar, data bound to the result of the query. The rows of a list box can be complex controls (or groups of controls), by changing the ItemTemplate.
|
|
|
|
|
Thank you all for your assistance
|
|
|
|
|
I want use dll to create a program that can received sms from
mobile and do something;
1-which dll can I used?
2-which mobiles can supported?
pls i want quick answer ;
note : the mobile connected with computer by a USB cable;
I use C# 2010;
modified 25-Oct-12 6:02am.
|
|
|
|
|
Saied Ghazal wrote: pls i want quick answer
That's rude.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
If you want quick answers then there are three things you should do:
1) Don't use a subject like "Hi All" - it tells us nothing about your problem and is thus a complete waste of time - yours and ours.
2) Don't damand a quick answer - that is rude (as has been mentioned) and thus can delay answers rather than encouraging them. Remember that you do not pay our wages even indirectly, so you are not in a position to demand our attention.
3) Try google. It is quick and easy - heck even my wife can use it - and if you try even a little bit you can find an answer without working up a sweat. I did - it took about 20 seconds to find a page with relevant info starting with a text string copied from your question.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Here[^]
read it and update this post.
|
|
|
|
|
Greetings Members Of Code Project,
Zero Clue King here; eagerly awaiting clueless newbee status.
This is my first post; so apologies offered in advance for any perceived idiocy or ignorance of the prevailing protocols.
The question: I want to click one button, and send one byte across a serial port.
I want to do this in C#
I'm currently reading, "Basic serial port listening application By Amund Gjersøe" from two years ago on another page on this site.
I have my app set up in Visual C# (I think it's 2010) with some buttons, a combo box, and a serial port. Not sure how to post a screen cap, etc.., probably not even needed.
I can open the port, close the port, give it a name, etc.. The moment I try to do anything that has anything to do with the word "write" it seems that C# changes from nice to malicious.
I just want to get a grasp of the elementary concepts behind sending a byte out the serial port.
We'll get into multi-threading and such things later. For now, I would like to focus on the brass tacks of sending one byte out the serial port.
This is the thing that is most confusing to me: I want to send an honest to goodness byte, just 8-bits, and nothing else. It probably will not be ascii text. In fact, I know it won't be for the first several times.
After I get one byte out, I will want to get more fancy and send various combinations. For the moment, just one byte is the goal.
Again, newbee here; don't know one thing from another, so searching is not a polished skill at the moment.
I want to assure any reader that I have indeed searched via Google, Bing, and Yahoo, and MSDN, and YouTube tutorials, and Plan Nine, and everywhere. It appears that SEO has rendered their results as mostly obfuscation these days; desperate to make buck, I guess.
I am astounded that this little task doesn't have several tutorials and code examples floating all around the internet.
|
|
|
|
|
C-P-User-3 wrote: I am astounded that this little task doesn't have several tutorials and code
examples floating all around the internet.
Actually, there's tons of them. Such as this one[^] and this one[^].
There are two common problems people run into. The most common is that they don't set the serial port up with the correct communication parameters, such as baud rate, bits per byte, number of stop bits and parity. You can't just set whatever you want on your side and expect the other side to understand.
BOTH sides have to be setup with the same parameters.
The other most common problem is using a cable with the wrong pinouts. That also has to be correct otherwise you'll be sending data on the correct pin on your side, but going to the wrong pin on the other.
|
|
|
|
|
Thank you Dave and Gerry for your feedback.
My original post was long enough as is (as was ?) so I didn't want to jam in any additional details.
The wires are working.
I am (totally) confident of the physical wires and connections, because I have been using them with various software packages to send and receive data from an external embedded system. Those packages have demonstrated successful sending and receiving from the device; as in,,,
--- I send out a specifically formatted group of bytes
--- The device responds with the proper sequence of bytes
i.e., things are working fine and it's time for me to get on with the user interface
I have pretty extensive control over the external box; to the point of single stepping the CPU instructions if I need that.
I can set up the UARTs (the external box has several of them) to generate an interrupt (i.e., an int in the external box) when various things happen; including the reception of a byte. If the byte is no good, it typically means that the frames are wrong, and even more typically almost every time because the start/stop/data/parity settings are off. When the speeds are out of whack it gets downright bizzare (as one would expect).
So, with that in mind, I want to assure you that I have indeed done much more than a loopback test in Hyperterminal: I've used these very machines and these very wires to communicate with the device being developed.
But then again, yes, that's the first culprit when bytes don't go across.
Gerry Schmitz wrote...
"...one typically doesn't just "send"; ... almost always a "response" ..."
Correct.
Walk before we run.
This is why I want to develop one app that just sends one byte as the result of clicking one button just one time.
The examples I've seen here are almost universally embellished with extensive controls, boxes, etc., and that's great.
My point is that by focusing on the bare minimum, at the start, the process of reading, turns to writing, turns to observing, turns to practicing, turns to refining, turns to learning, and ultimately turns into understanding.
The fully functional app is not good for that at all.
Dave Kreskowiak wrote...
"...Actually, there's tons of them. Such as this one[^] and this one[^]...."
Correct, and that's where the learning curve goes vertical, or even Bezier, as in backwards or way off the path of the desired goal.
Yes, they contain the specific concept that I want to explore, but that concept is enshrouded with lots of other stuff (which I totally understand; they want to demonstrate a working useful app; not a specific isolated single concept) which requires ancillary and extraneous factors. This is what thwarts learning; at least for me: i.e., hiding the trees in the forest.
The "forest", in this case, is the C# vocabulary. The trees all look alike, so you can't find the one you want. In like manner, the specific syntactical invocation of the method/class/whatever is hidden because of the interactions of the seventeen other things the application has to do.
Yes, you are correct, nobody on earth is going to buy an app that sends one byte out the serial port when you click one button.
However, I believe that that "app" would be exactly the first one that should be studied by anyone who really wants to understand the construction of a C# user interface that is communicating with a device outside the computer.
More to the point, in one of those examples, I find a line of code which is exactly what I want to do, Here's that line...
// Write a set of bytes
port.Write(new byte[] {0x0A, 0xE2, 0xFF}, 0, 3);
So, I think, "Yes, that's what I want" and try to put something similar in my code. Nope, errors. So I try cutting and pasting that exact line, verbatim. Again; Nope ! When I attempt to put it into my code, total Ka-Bong, life goes fail, fail, and more fail.
Again, I can set up my external box to interrupt me when I get the first byte from its UART, and I'm also quite confident of the physical medium connecting it based on consistently observed behavior established over several months now; I'll just toss out a guess of 10 million bytes properly transmitted and received.
I hope this is not rambling or needless philosophical debate.
I'm just trying to write an app where I click one button one time and get one byte out of the serial port.
Following true engineering psychology, nerds everywhere jump on anything simple and immediatly go, "Oh boy ! That's easy ! Let's add fifty steps of complexity to the problem !", which is what I sortta'kinda see happening everywhere I ask this question.
If I don't miss my guess, the final stuff here will be less than twenty lines of code when I get it figured out and actually type them at the keyboard.
Perhaps this is where we could really...
[A] help me, a lot and
[B] increase the popularity of this site.
I want an idea of the twenty lines of code that will send one byte when I click on one button. You have hundreds, thousands, maybe millions of lines of code here.
Can you show me the ones that I want right now ?
|
|
|
|
|
|
Thanks Dave,
I clicked on the link and arrived on this page...
http://msdn.microsoft.com/en-us/library/y2sxhat8.aspx
... Which has the title, "...SerialPort.Write Method..." I find this sentence...
"...By default, SerialPort uses ASCIIEncoding to encode the characters. ASCIIEncoding encodes all characters greater than 127 as (char)63 or '?'.
That is absolutely not what I want.
The next sentence after that says...
"...To support additional characters in that range, set Encoding to UTF8Encoding, UTF32Encoding, or UnicodeEncoding...."
I made the guess that I did *NOT* want UTF32Encoding, or UnicodeEncoding, which left the one choice of UTF8Encoding.
I clicked on that link and came to this page....
http://msdn.microsoft.com/en-us/library/system.text.utf8encoding.aspx
...which had the title, "UTF8Encoding Class".
That class has 3 constructors, 13 properties, and 33 methods.
The 11th of those 13 properties is, "IsSingleByte", which led me to believe that that might be of interest to me. The description of that property read as follows...
"...When overridden in a derived class, gets a value indicating whether the current encoding uses single-byte code points. (Inherited from Encoding.)..."
The word "Encoding" was within a href link as well, so I had to choose which to view first. The "IsSingleByte" looked most likely, so I clicked on that link.
That click to me to this page...
http://msdn.microsoft.com/en-us/library/system.text.encoding.issinglebyte.aspx
Which had the title, "...Encoding.IsSingleByte Property..."
This seemed to be a property with a boolean [True|False] value. An example is present on that web page. The results are all "True" and "False" values, so this may or may not be relevant to my interests.
On that page, I saw this blurb...
========================================CLIP========================================
Caution
You should be careful in what your application does with the value for IsSingleByte. An assumption of how an Encoding will proceed may still be wrong. For example, Windows-1252 has a value of true for Encoding.IsSingleByte, but Encoding.GetMaxByteCount(1) returns 2. This is because the method considers potential leftover surrogates from a previous decoder operation.
========================================CLIP========================================
...so I just sat there and wondered what thoughts were in their mind when they wrote that.
If I knew what "Windows-1252" was I might understand more (as of this writing, I'm still using Win'7, hoping the boss will buy me Win'8).
After that, I returned to the previous page from which this link was acquired to look at the "Encoding" link.
I arrived at this page...
http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx
...which had the title, "...Encoding Class..."
There were 2 constructors, 21 properties, and 33 methods.
Of the 21 properties, the 15th was "IsSingleByte", the same link I had earlier clicked, so I didn't want to follow a circular paradigm.
The 19th property was "UTF8" with the description "Gets an encoding for the UTF-8 format" so I guessed that that might be it. I clicked and arrived at this page...
http://msdn.microsoft.com/en-us/library/system.text.encoding.utf8.aspx
...Which had the title, "...Encoding.UTF8 Property..."
Where I read, "...This property returns a UTF8Encoding object that encodes Unicode characters into a sequence of one to four bytes per character..."
That is, again, exactly and precisely what I **DO**NOT** want. I want to send out UN-encoded bytes; just regular 8 bit values.
So, I am encountering circular logic with no end and no answer. I could really use some advice on how to send one byte (any one of 256 possible values) by itself, without encoding extra bytes to go along with it, out the serial port.
Does C# provide such a capability ?
|
|
|
|
|
|