|
Hi,
How do I get the installation path that the user selects while installing ?
If I had to copy a specific file from a folder in the local machine under the path where the application is installed , How do I do it ?(for eg : if I have a file named aaaa.dll which is tend to change frequently in the same folder as I have the setup.exe , if the installation path selected is C: and I have created 2 folders bin & data under it using File system editor in setup .How can I copy aaaa.dll to bin & data folder at runtime).
Thankx in advance
Priya
|
|
|
|
|
You already asked this and it was answered. Please refer to your previous post for replies.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I recently encountered an installer which checks if the .NET Framework is installed on the target PC before installing the application itself. If the .NET Framework is not installed, it automatically installs the .NET Framework.
Any idea how this was done? I assume that the "Setup Project" was used for this because the application was created using MS Visual Studio .NET.
also:
How can I call a DOS command after the installer copies the files onto the installation directory?
For example:
After copying the files ("Copying Files: 100%"), can I call the executable "CABARC.exe" to extract some Cabinet (*.cab) files which were copied on the installation directory?
Thanks and God Bless.
Rafferty
|
|
|
|
|
No, VS.NET's setup project does not do this. You have to use a bootstrapper (an executable that performs certain checks - like checking for a particular version of the .NET Framework - before starting another setup, like the Windows Installer package created by VS.NET).
Microsoft does already have a solution for this. Read Creating a Single Setup Project to Install a .NET Framework Application and Dotnetfx.exe[^] in the .NET Developers Guide for more information.
There are also a couple bootstrappers that users have written here on CodeProject. One in particular can also install other components like MDAC. Just trying searching CodeProject if you're interested.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Can you give me more information about this bootstrapper?
From what I understood, the bootstrapper is the Setup.exe included (when you build the Setup Project) along with the ProjectSetup.msi. And that the bootstrapper is configured by modifying the Settings.ini correct?
|
|
|
|
|
Yes, it's all discussed in the link I gave you. It's pretty straight forward.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
For .NET Remoting in .NET 1.1, there were some changes made that could lead to the problems you're seeing. Read Automatic Deserialization in .NET Remoting[^] for more information.
Also, while it's typically not needed, you may need to add a URL membership condition (use -url for caspol.exe, or select Url in the drop-down if using the Microsoft .NET Framework Configuration MMC snap-in) with the necessary permissions.
If either possibility does not prove effective, please provide the exception type and message, otherwise it's practically impossible to accurately determine the problem.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a COM component that exposes a collection class. When I try to iterate the collection via interop using the c#.net code below, I get "QI for IEnumVARIANT failed on the unmanaged server." on the foreach line. Is my code correct? It compiles without problems but fails at runtime. The result count returned, however is correct.
ZyDocuments ZyDocs; // IEnumerable
ZyDocs = ZySearch.GetResults();
TextBox1.Text = "Result count: " + ZyDocs.Count;
foreach( ZyDocument z in ZyDocs)
ResultList.Items.Add( z.FileName );
Any ideas what this error means?
|
|
|
|
|
Hi all,
I would like to ask a question as below,
My software is composed of a main C# program with some other c# dll as components. In the first round, I will install all the stuff on the machine.
Then after sometime, I need to install some additional dll to work with
the main C# program. How can I do that ? Is that possible in C#.Net framework ?
The scenario is similiar to install Microsoft Office Suite, at the first time, I only install MS WORD with the MS Office main framework, but later I install also MS Excel (just like i install another DLL in my application)
onto the MS Office Main program on the PC.
Thanks
|
|
|
|
|
Sorry I wanna ask another question but it is related with ur subject i hope u can reply me
My app is a C# app .
I made the setup project to the app and i installed the .Net framework to make it run in win 8\98 environment but it is failed
Do u know what else the C# app needs to run in WIN 98 Environment ?
|
|
|
|
|
I am using vs. net
and there is no problem
|
|
|
|
|
When i developed in VB I created my own trace capability. It maintained recent trace entries in memory. I wonder if i can do the same with the Net Trace/Debug classes. Example, application will retain the last 100 trace entries in memory; when exception occurs, central error handler dumps trace information and creates error report. Can this scenario work with the Net Trace/Debug classes? Or do i need to write my own code? Can someone enlighten me on the How To? Coming from a VB background, the Net framework is a little over-whelming right now. I have read the Microsoft books and documentation but it appears the classes only do simple streaming using a "Listener" and cannot maintain a fixed-size collection/array or similar that will never hold more than a finite number of Trace/Debug entries.
Any advice is appreciated as i have exhausted my own research.
|
|
|
|
|
Extend the TraceListener class and register it using either the <trace> configuration section (under the <system.diagnostics> section) or add it programmatically to the Trace.Listeners and/or Debug.Listeners collection properties.
Your implementation of the TraceListener will work with the Trace and Debug class members and can do whatever it wants, from saving information in memory (caution, though - because of stack traces this can use a tremendous amount of memory) to writing to an XML Web Service and more.
Keep in mind the .NET tracing functionality in the .NET FCL really isn't very good. Whether your listener will use the information or not, it's still passed to your listener. I would recommend reading about the Exception Management Application Block for .NET[^] in the MSDN Patterns and Practices section.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath,
From another post i started figuring out that a custom Trace Listener can be made. This will allow me to do what i want. I took a look at the Exception Mangement Block- looks almost too good to be true! Cool find. Thanks for sharing.
--Llyal
|
|
|
|
|
thanks for reading.
i've built a .Net assembly in C#, have created a TLB file using regasm and built a VB COM dll with reference to the TLB. it all works swell on my machine here through a 3rd party application that calls the VB COM DLL.
i want to move the whole thing to another remote machine with the same 3rd party app installed and avoid recompiling / using any development tools.
i think i can do the following: ... is this correct?
1. make sure TLB is in same folder as VB COM dll
2. regsvr32 the VB COM dll
3. put .Net dll in GAC
i'm asking instead of just trying because of limited time and computers and my client is hoping to see this working today. i thought i'd give a shout for help to see how close i was.
again, thanks for reading.
|
|
|
|
|
You forgot step 4: run regasm.exe on your .NET assembly to register it as well.
Also make sure that you follow good COM guidelines in your .NET CCW (COM-Callable Wrapper), such as not using auto-generated class interfaces, always specifying a CLSID or IID using the GuidAttribute , etc. Read Creating a CCW for COM-enabled, non-.NET Applications[^] for more information, and pay close attention the parts Nick mentions that I asked him to add. This is also documented - albeit poorly - in the .NET Framework SDK but comes mostly from experience with COM.
Just out of curiousity, why expose the .NET assembly as a COM server, then wrap that with another COM server written in VB (by which I assume you mean VB6)? Why not just let COM clients reference the CCW?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for your reply, Heath ...
Heath Stewart wrote:
You forgot step 4: run regasm.exe on your .NET assembly to register it as well.
Doesn't this mean I have to recompile the VB6 COM (yes, you were right) DLL again? Before you wince, please read my next few lines ... i wasn't being modest when i said "newbie"
Heath Stewart wrote:
Just out of curiousity, why expose the .NET assembly as a COM server, then wrap that with another COM server written in VB (by which I assume you mean VB6)? Why not just let COM clients reference the CCW?
Ignorance. Plain and simple.
When I got into this sub-sub-task of a much larger project, all I knew was that our coding team had something written in .Net that needed to be connected to something that knows how to call VB6 COM components. I sent out a few emails for help from several people without much response and then ran some experiments (even though they were designed and conducted out of the same ignorance mentioned above, plain and simple ) and finally came to the conclusion that the setup I had was the setup I needed. Basically as soon as it worked, i stopped experimenting.
I would certainly appreciate more input, if it's not too much to ask, on this specific issue and how it can be improved.
if this isn't the forum for what might become a painful series of questions and obvious answers, feel free to email me directly at sherif@amgando.org
again, thanks.
sherif
|
|
|
|
|
sherif wrote:
Doesn't this mean I have to recompile the VB6 COM (yes, you were right) DLL again?
No. When you compiled the assembly, if GuidAttribute s weren't used the internal GUID of the type that is generated at compile-time is used and will not change so long as you don't recompile the project. If you do, then you will need to re-add the typelib to the VB COM DLL and recompile it. This is another good reason to use the GuidAttribute for any COM-visible (read about the ComVisibleAttribute in the .NET Framework SDK) type. Class GUIDs (CLSIDs) should almost never change, and interface GUIDs (IIDs) should change from version to version (which means that interfaces - once published - should never change definitions; just inherit from the old interface with a new one and implement the new interface as the first interface for your class).
If you're looking to improve your COM interop skills, I suggest you pick up a good book on COM interop with .NET. I know that Microsoft Press[^] has one or two (I don't know how good they are - I learned all this through many years of experience with COM and as many years possible with .NET) and I'm betting there's a few more from other publishers you can find on Amazon[^] or something.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Anyone know how to set the Window class name for the main form of a Windows Forms .Net application? By default, they get class names like "WindowsForms10.Window.8.app3" -- I searched through all the files in the project and can't see where that's coming from. I didn't see anything in the base Form or in the Application object that does it, either...
Unfortunately, the overloaded nature of the words "window" and "class" make searching the help herculean task.
I need to have a well-defined class name (not the semi-random one that is autogenerated), so that I can find the app at runtime with FindWindow(); since the titlebar may be localized and may have additional stuff (like "My Localized AppName - Current document name.ext"), I would rather use a class name which could be more dependable.
Matt Gerrans
|
|
|
|
|
The "semi-random" one is not actually random - if you specify a registered window class. The window class is actually used in well-defined pattern. If the control does not have a window class associated with it, then it becomes random (though the basic pattern is still used).
Just like with VC++, MFC, etc., you need to either use a window class that is already registered (like Static, Button, etc.) or register your own a la RegisterClassEx , which uses the WNDCLASSEX structure. You can P/Invoke this easily enough.
Register the class (with a classname of your choosing, so long as it doesn't already exist) once, then override CreateParams in your Control derivative and set the CreateParams.ClassName as well as any other extended, window, or class styles you want.
Also, if you're merely looking for your application, you might consider enumerating Process.GetProcesses (which can also gets the processes given an executable name). Using the Process class's properties, you can discover additional information. If you need an HWND at any point, just use Process.MainWindowHandle .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
I'm not clear on how you can change the CreateParams of the app's main form, since it is a protected member of the Control class, which is a few bases up the hierarchy from the Form class. Are you talking about creating a derivation of Control and replacing the main form with it?
I had considered the Process stuff, but was worried it wouldn't work with limited user accounts. However, I've just tried that and it works fine. I didn't know (or expect) that it had that MainWindowHandle property, either; that works out excellently; in fact, it looks like it is quite easy to get all the useful process and window information from the Process object (unlike in the Windows API, where it is a bit more complicated to connect processes information to window information). I think I'll go this route and be able to take care of what I need to do by using the process list.
Thanks Heath!
Matt Gerrans
|
|
|
|
|
Gerrans wrote:
I'm not clear on how you can change the CreateParams of the app's main form, since it is a protected member of the Control class, which is a few bases up the hierarchy from the Form class.
By extending the Form class with your own class, then override the CreateParams . If you want to just change a style, you typically get the base.CreateParams , modify, and return it; but in your case you're changing the class name - a pretty big change. Construct your CreateParams , change the styles and class name, etc., then return it.
Gerrans wrote:
I didn't know (or expect) that it had that MainWindowHandle property
You should browse through the Class Library documentation in the .NET Framework SDK. It's not like you have to memorize everything, but you should recognize a naming pattern that Microsoft sticks to about 98% of the time (according to FxCop). That makes it easy to find what you need, especially if you have some idea of what to look for.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a VB.Net Windows service that needs to access a network drive. The code works as desired as a console app on the server but fails on the network share access as a Windows service. I have used both the Local System account as well as the local admin account to run the service. Same results both times. In ASP.NET I know the work around is to use Identity Impersonate in the web.config file but this is a Windows app not a web app. Any suggestions are appreciated and I apologize for the cross post.
"Your destiny lies before you, choose wisely."
|
|
|
|
|
You must either run under a domain account (and account that works on the domain and has permissions to that folder) or configure the user account which the service runs under using the same username and password (a trick useful on workgroups). Both the local administrator and local system accounts are local accounts.
The reason impersonation works is because, using a domain, the user's credentials are used which would be a domain account. Same for when you run your console application - it's running with a domain user's credentials.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|