|
I have a windows installer (deployment project) as part of my VB.net solution. It is set up to remove previous versions prior to being installed. As part of the installation process, several configuration files are installed onto the machine along with the application.
I would like to set it up so that when the application is installed, it creates the configuration file if none exists, but leaves the file otherwise. I would also like to be able to flag in some instances that the file should overwrite regardless of whether the file exists or not.
Any pointers on how I can set this up in the deployment project, as I have not found a good source of information regarding it.
Thanks for the feedback,
sc
|
|
|
|
|
Sorry, there is no easy answer to this question. Forcing overwrites is easy - set the version of a file in a new install higher than previous versions, and it will always be installed.
Conditional install is much trickier and depends on Version, Date, and Language. Rules for non-versioned files are different.
The VS Installer provides a very limited interface. You will probably have to modify the msi database manually to accomplish what you need.
You can download the full Windows Installer documentation, along with tools that allow you to edit msi packages from MS:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/default.htm?p=/msdownload/platformsdk/sdkupdate/SDKInfo.htm[^]
Editing msi table is not for the faint of heart. You can find a free e-book here:
http://www.larkware.com/InstallerBook.zip
You can also find forums and resources at:
http://www.installsite.org/[^]
Unless you really want to become an expert on Windows Installer technology, I suggest you farm it out to someone who already is.
|
|
|
|
|
Thanks for the feedback and info.
I was kind of afraid it was going to be as you describe it, but was hoping I had missed something simple. Apparently not. I'll look through the sites and try to guage what it will be like, but as this is a "nice to have but non-essential" item, I'll probably just give it a pass.
Thanks again.
|
|
|
|
|
Hi!
I've several client applications which call methods of singlecall objects on the same server. Now my question is wether the server processes requests which come at the same time parallel (implicit by multithreading) or serial?
Thanks in advance!
|
|
|
|
|
The remoting framework takes care of synchronization for you. You don't have to write any synchronization code. Each client will get it's own singlecall object.
Regards
Senthil
My Blog
|
|
|
|
|
Is polling really the only way to get information about a clients connection status. I am work on an application where more the one client is connected to my server app. and I need a notification when a client disconnects. Can anyone help me?
|
|
|
|
|
Is there anything out there that allows .net applications to run without the need for the huge .net framework to be installed?
I know about salamander linker and thinstall, but are there other tools or ways to do that?
|
|
|
|
|
nope.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
I've heared that it's easily possible to view IL code of a compiled application. How is it possible ? Obviously, you don't need to decompile or disassemble it, as it's already IL code, but just in byte-code, right ? So how can you get it back to text mode, so that you could actually view the IL code (in a text editor) ?
Regards, Desmond
|
|
|
|
|
ILDASM[^] will do this for you. It is part of the >NET Framework SDK[^]
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Thanks. That did it.
How does it work (how can I make my own ildasm.exe theoretically) ? I mean, the compiled exe should be already IL (just in byte-code), right ? So what does ildasm actually do ? Does it just converst byte-code to text somehow or what ?
Regards, Desmond
|
|
|
|
|
Assemblies contain IL, which is similar to assembly language in sytax. So it should be fairly easy to write a tool like ildasm, all you need to know is the structure of .NET executable and the byte encodings for various IL instructions.
Regards
Senthil
My Blog
|
|
|
|
|
Hello,
I have some problems with user controls that I made.
Lately these controls have a bad habit of dissappearing when I open the form in designer.
It seems that visual studio messes up the generated code.
Is there a bug fix or a work around for this issue?
|
|
|
|
|
Hi all
I have a custom usercontrol in my window form "frmsett.cs" .
"initializecomponents" of "frmsett.cs" initialises usercontrol
This usercontrol is derived from a base component class.
Usercontrol populates printer informations.
we populate default printer related informations to usercontrol through Pinfo() method (a function in base component class )
Pinfo() invokes getinfo()(another function in base component class ) using methodinvoker and asynccallback
My "basecomponent" class definition starts with
[ClassInterface(ClassInterfaceType.None), ComVisible(false)]
when i call frmsett.showdialog() Applcation is developed and works perfectly in .NET framework 1.1
Then I installed .NET framework 1.1 SP1
Here the problem begins. When application executes ShowDialog(Only at first call) It hangs for some minutes (5-15 mins) before showing the dialog "frmsett" . If we clicked second time it will display the screen immedialtely.
Anyone come across this type of issues???
Is there any problems asynccallback with methodinvoker in .NET fx1.1 SP1
What is the reason for this problem in .NET fx1.1 SP1???
Thanks a lot for any tips !!!!
Regards
Krishnan
If u can Dream... U can do it
|
|
|
|
|
I am looking for a component in .net to send fax withing an ASP.net page.
I don't want to use a webservice nor to send fax over WEB.
All I need is a third party component that I can use it in my ASP.net application to trigger a fax modem installed on the server to fax an HTML page
Thanks
Arvind
|
|
|
|
|
hi,
i am using for my current project in that i have to search the html file for certain keyword like 'overrule' for searching this i am using regular expression.
i am able to search word 'overrule' but failed when the word 'overrule' is like this '[overrule'.
how i can do that? can anybody help me?
code is.........
Key_Word="overrul"
ObjRe.Pattern = Key_Word & "[a-z]"
Set ObjMatches = ObjRe.Execute(FileMatter)
lCnt = ObjMatches.Count
Thank in Advance
Syed
|
|
|
|
|
I have build an application in which I use file names from a directory.
to get these file names I used the following code from MSDN.this code requires mscorlib.dll
to be included in the application
#using <mscorlib.dll>
FILE * fp;
String *extension;
// Create a reference to the current directory.
DirectoryInfo* di = new DirectoryInfo("C:\Sachin");
// Create an array representing the files in the current directory.
FileInfo* fi[] = di->GetFiles();
// write the names of the files in the current directory.
Collections::IEnumerator* myEnum = fi->GetEnumerator();
fp = fopen("nest.lst","w+");
while (myEnum->MoveNext())
{
FileInfo* fiTemp =__try_cast<fileinfo*>(myEnum->Current);
//Console::WriteLine(fiTemp->Name);
extension = Path::GetExtension(fiTemp->Name);
fprintf(fp,"%s\t%s\n",fiTemp->Name,extension);
}
fclose(fp);
this code works using
#using <mscorlib.dll> with /clr option.
this is working fine on my machine.
but i fail to run this application on another machine that doesnt have visual studio installed. As i dont know how to specify path for this dll at run time.
thanks
sachin
|
|
|
|
|
|
Thankyou Colin now I m able to do this.
|
|
|
|
|
and make sure that you compile to "release" not to "debug"
Why a sin?
|
|
|
|
|
:(i have problem with Font and
i couln'd resolve it by myself. Could you please give me some help on
this?
My problem is how to compress a Font (changing the character's width
while its height remains unchanged) ? I can do it in VB6, but in
VB.Net I couldn't. Here is my code:
<structlayout(layoutkind.sequential, charset:="CharSet.Auto)"> Public _
Class LOGFONT
Public lfHeight As Integer
Public lfWidth As Integer
Public lfEscapement As Integer
Public lfOrientation As Integer
Public lfWeight As Integer
Public lfItalic As Byte
Public lfUnderline As Byte
Public lfStrikeOut As Byte
Public lfCharSet As Byte
Public lfOutPrecision As Byte
Public lfClipPrecision As Byte
Public lfQuality As Byte
Public lfPitchAndFamily As Byte
<marshalas(unmanagedtype.byvaltstr, sizeconst:="32)"> _
Public lfFaceName As String
End Class
Public Shared Function CreateLogFont() As LOGFONT
Dim tmpfont As Font
Dim tmpLogFont As New LOGFONT
tmpfont = New System.Drawing.Font("Courier New", 27.0)
tmpfont.ToLogFont(tmpLogFont)
tmpLogFont.lfHeight = 15
tmpLogFont.lfWidth = 10
Return tmpLogFont
End Function
After creating tmpLogFont, i create new font for my TextBox
Public Sub New()
MyBase.New()
Dim lf As New LOGFONT
Dim tmpfont As new Font
tmpfont = tmpfont.FromLogFont(CreateLogFont)
Me.Font = tmpfont
End Sub
The only thing changed is the font height, and the font width
(lfWidth) remains 0!
is there any error in my code?
I tried again, but by using API function CreateFontIndirect, and got
the same result !
Could you give me an example for compressing fonts?
Thank you very much
Best regards.
|
|
|
|
|
Here's something I wish to learn about how Windows OS interacts with .NET:
Every Windows Forms Control has the ability to handle one or more mouse actions - left click, double click etc. For example, .NET allows this by generating a Click event for the relevant control everytime the mouse is left clicked.
What I wish to understand is that how does .NET know which Control to generate the Click event for. In other words, if I click on a particular button, the OS recognizes the point on the screen where the click occurs, then translates that information and sends it to .NET which identifies which control does the click correspond to. That, at least, I believe is the chronology.
But I'm not sure how this translation between the OS and .NET takes place. Any help is greatly appreciated.
Thanks..
Sarabjit.
|
|
|
|
|
I think it is done the way normal Windows apps do, through a Window procedure that is called from a message loop. The window procedure simply calls the delegates registered for that event. The Winforms button is a normal Windows button wrapped in managed code. There are no native .NET UI controls, AFAIK
Regards
Senthil
|
|
|
|
|
Thanks for the help.. Though I'm still not completely clear:
"The window procedure simply calls the delegates registered for that event"
As per my impression, delegates that make calls to the respective event handlers whenever an event for a Control is raised are invoked inside the Control itself. Thus, to "simply call the delegates," the Windows procedure should first be able to identify which Control is it going to call the delegates of.
Thus, either Windows directly makes a call to this Control, or it simply passes the event to the active process, which (by virtue of routines that were directly added by .NET when the program was compiled) then makes a call to this Control (specifically, to the OnEventName() method within the definition of this control). In both these cases however, there needs to be a way to identify which Control (button, scrollbar etc.)does the specific click correspond to.
In other words, a literal translation between the co-ordinates of the pointer when the mouse was clicked and the Control the pointer was above at that time takes place. It is this translation that I need to get at the root of.
"The Winforms button is a normal Windows button wrapped in managed code. There are no native .NET UI controls"
I think you're right. I guess the .NET's only purpose - like that of any runtime environment - is to successfully compile and debug the code, adding any extra routines that it might need to. A few examples of such actions which are relevant to our context here and which .NET directly takes care of are:
1. Delegate definitions - A delegate declaration is sufficient to define a delegate class. The declaration supplies the signature of the delegate, and the common language runtime provides the complete implementation.
2. Event Wiring - A designer such as Visual Studio .NET automatically completes the event wiring by generating code which is necessary for the purpose.
3. Event Hooks - When the compiler encounters an event keyword (such as - public event HandlerNameEventHandler HandlerInstant;), it creates a private member such as and two public methods: add_Alarm and remove_Alarm. These methods are event hooks that allow delegates to be combined or removed from the event delegate. The details are hidden from the programmer.
(The above are taken from the MSDN Library: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconevents.asp)
Once the self-executable/dll is ready, .NET I believe is out of the picture.
Thanks for the help anyways..
|
|
|
|
|
My guess:
The ability to perform this information transfer and detect the specific Control whose delegates need to be referenced in response to the particular event is NOT performed by the Operating System but by the process - the application itself.
However, the routines to achieve this are not written by the application programmer. They are instead a part of the specific libraries the programmer includes in his project. As a result, these are included in the application at compile-time by the respective compiler (the .NET compiler in this case). After all, it is the environment's job to provide the I/O interface to the application programmer.
AFAIK..
Any thoughts're welcome..
Cheers..
|
|
|
|