|
Wow - you have actual code written for the installer. I've been through the project in Visual Studio .NET 2003 and I can't even see anywhere that code can be written / edited. I'm assuming you are doing this through another means?
Thanks for your help!
Ken
|
|
|
|
|
Ken,
It took one guy that is a 'walking MSDN' to aid in finding this nugget of info. Check the link in my code comments for additional info.
For custom installer code you have to bake your own! Do this:
Create your Setup project within your solution.
Add another project that will ba a class library.
Create code similar to what I posted earlier.
Include output of that class library in your project file system.
Right-click the setup project and View...Custom Actions.
Add the project output for your custom installer at the point you want.
Compile everything.
Caviat Emptor
When you add the project output to your setup project, you do not seem capable of marking the properties (like it should be hidden, system, read-only) as near as I can determine. So the DLL is visible to your users and deleting the DLL can make your code unable to be uninstalled AND uninstallable. (can't remove it, can't install until you remove it)
I referenced the DLL directly but then source management gets freaky and keeps claiming the source control has a different DLL version and should it be left or overlayed.
So you are damned if you do and you are damned if you don't.
Michael
This signature left intentionally blank
|
|
|
|
|
I'm new to C# but not programming. I need to dynamically load dlls (native) and I have that part working with the [DllImport .... LoadLibrary ], and the with GetProcAddress.
What I am having trouble with, is the returning value from GetProcAddress. I have it returning an IntPtr. It is valid and I assume I should be able to use it.
In C++ I can cast the pointer to a function pointer. Is this possible in C#? I understand in .NET that function pointers are delegates and that you can't cast an IntPtr to a delegate type. So how do I go about calling the function that i have just obtained from a DLL?
Thanx
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
|
1. why would I search when I know that Heath Stewart answers questions on this forum within 20 mins?
2. I did actually search and find that, but that tells me that it'll be available in .NET 2.0. I thought maybe someone had a work around for pre 2.0.
There's gotta be some guru out there that has done it ?
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
|
Leppie,
thats a little harsh isn't it?
p.s. I wasn't the one that gave you the 1. For something as intelligent as your comment, it isn't worth it.
Jubjub
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
1. Because you always should search first. Good research is required skill for any good developer, and with forums like you have here today it's so easy compared to when I first started programming (no web; only gopher).
2. Nick did provide a work around that does work (though P/Invoking LoadLibrary really isn't necessary unless you want to check whether or not the DLL was actually loaded successfully since invoking the imported function won't tell you). Using the DllImportAttribute , the CLR will load the referenced DLL when necessary. You should still be able to unload it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanx for your help Heath. Much appreciated.
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
hi all,
I want to trasfer data from access to SQL. I am doing this in .Net ,using C#.I did it like this:-
this.oleDbDataAdapter1.Fill(this.dataSet11,"AthleteArchive");
this.sqlDataAdapter1.Update(this.dataSet11,"AthleteArchive");
BUT this is not working...
"AthleteArchive" --is a table of the Access Database..oleDbDataAdapter1,sqlDataAdapter1 & dataSet11 are created using Wizards.(Drag & Drop the Relevent Table to the Design view)
Can u please tell me, what is the Problem in there and How do I correct this?
thanks...
|
|
|
|
|
First of all, SQL Server already includes DTS (Data Transformation Services) that is better for this job, and it even provides programmatic (through COM, which you can interop for use with .NET) access to DTS transforms. This is the preferred way of doing it, and you can read much more about it in the Books Online documentation for SQL Server that should be installed as well.
You need to look at the SqlDataAdapter.TableMappings collection property documentation, as well as related documentation (follow the links), in the .NET Framework SDK. This dictates how to map result sets to table names in a DataSet , and you have to add the named DataTable to the DataSet . Be sure to read about typed DataSet s in the ADO.NET portion of the .NET Framework SDK. If you create a typed DataSet in VS.NET, this will make things much easier (right-click on your project, select Add->Add New Item->DataSet and design it using elements (tables) and child elements (fields)).
You should also read the documentation for DataAdapter.Fill and Update . Unless you want ot copy data table-by-table, you should just use the single parameter overload which takes a DataSet . Assuming your DataSet has the right structure (tables and fields) and - if applicable - relationships, data will be copied correctly (so long as any foreign key constraints or data constraints in the DataSet aren't violated).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have an application that generates an archive of log in the following format (log.txt): dd/mm/yy hh:mm:ss [ name of the user ] [ description ].
I need that when the application will be initiated it it verifies this register that removes the register dated in d-3.
Regards
Flavio Serrazes
|
|
|
|
|
Flavio Serrazes wrote:
I have an application that generates an archive of log in the following format (log.txt): dd/mm/yy hh:mm:ss [ name of the user ] [ description ].
I need that when the application will be initiated it it verifies this register that removes the register dated in d-3.
This makes no sense what-so-ever. What register? What's "d-3"? And what does it have to do with a log file?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi All..
I have some code in c++ and change to c# as below:
<br />
uint dImageSize;<br />
byte pImage;<br />
byte pImagePtr;<br />
<br />
<br />
pImage = (byte)malloc(dImageSize);<br />
<br />
<br />
free(m_pImage);<br />
Any one could help me? Thank you.
hello ALL..^^
|
|
|
|
|
Rulala wrote:
pImage = (byte)malloc(dImageSize);
This is C, do you know why C++ was not used ?
malloc and free are used to allocate memory in C, in C++, new and delete are used. In C#, delete is not required, and the code would look like this:
using System.Drawing;
Image image = new Image();
That's it. Image.FromFile could be used instead to create an image in memory from a file.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi Christian , Thank you for your instruction.
About Image image = new Image();
If I need to define fixed size of memory(dImageSize).
How do I need to do?
Thank again.^^
Hello All , I'm rulala.
|
|
|
|
|
You don't need to delete it, but since Image implements IDisposable (and for good reason), you should call Dispose on the Image instance after you're done with it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath , Thank you for your reply .
I'm sorry that I didn't have detailed description.
How do I provide fixed size of buffer(memory) for code to use?
If I create Image() , Can I control memory size to Image?
Thank again.
hello ALL..^^
|
|
|
|
|
.NET is called a "managed environment" because the CLR manages the memory - you should not. The .NET Framework class library is there to encapsulate all this for you, and you should never assume a certain number of bytes for an image since different pixel formats and options can change that. If you want, you can P/Invoke unmanaged APIs and go back to managing all the memory yourself, but then what's the point of using a managed language like C# to target the CLR or another CLI implementation like Mono?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you very much .
You provide very good instruction.
Thank you...^^
hello ALL..^^
|
|
|
|
|
I have a class that I inherited from the DataGridTextBoxColumn class. There is a button that is in the textbox of this column, similar to a combobox button (only it has different functionality than the combobox). Anyways, first thing in the override Edit function, I am positioning the button so that it is on the right hand side of the TextBox.
The code seems simple enough...
myButton.SetBounds( this.TextBox.Width - this.TextBox.Height, 0, this.TextBox.Height, this.TextBox.Height );
Something is crazy about this though. This code works perfectly when the application runs under the .NET Framework 1.0.3705, and the button is always positioned exactly as desired. However, when the application runs under the .NET Framework 1.1, the button REFUSES to go where it is supposed to! What's the discrepancy between these versions, and what in the world am I doing wrong?
This isn't the only place I'm noticing a difference in the behavior of my program, but it seems like no matter what I do, I can't seem to prevent these effects from occurring. Need Help!
Thanks a ton!
|
|
|
|
|
Has anyone put a Chart from MSGraph onto a WinForm using C#? I have total programatic control of the Graph.Chart object in PowerPoint using C# through a COM AddIn but... I can't seem to figure out how to make it a control for a WinForm. aximp tool doesn't work because it expects an ActiveX control. Is there an OCX for Graph?
Thank you for any help you can provide.
Mark Finley
|
|
|
|
|
hi,
This may because of improper usage of commandline aximp .Try to add using add/remove component menu which is avilable once you right click the toolbox window. And choose Com compoenent
Microsoft Control 6.0 ( c:\windows\system32\mschrt20.ocx file.
If it doesn't serve your purpose please let me know that.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I have an application that I am deploying using a C# Setup and Deployment application. The project includes a number of different executables and other support and configuration files. What is happening is that if a file that was "laid down" by the install application is moved or deleted, a repair install is initiated when I access any of the shortcuts in the programs menu. The nature of my application requires that some of the installed files be moved to other locations on disk by the user after the install, but when we move the file a repair install is initiated. Is there a way to disable this option. I do not want the repair install to kick in if installed files have been moved.
|
|
|
|
|
The shortcuts are not normal shortcuts. They invoke the application through the MSI runtime, which first checks to make sure that components are where they should be.
You have several options: 1) don't use the Setup and Deployment project, 2) use a professional Windows Installer development environment like Wise for Windows Installer[^], or 3) hack the MSI package (using Orca, for example, which can be downloaded with the Platform SDK[^]). You can include a normal shortcut that is just like creating one manually on the desktop. This will not prompt the MSI runtime to check for the components.
You can also set attributes on the components that allow them to move around (untracked, mind you), but the Setup and Delpyment project is a base-bones, everything-done-for-you project not intended for serious use.
Microsoft MVP, Visual C#
My Articles
|
|
|
|