|
You could try setting the .Capture property of the help button's parent ToolStrip and see if that gets you further.
/ravi
|
|
|
|
|
I'm working on a application that will manage Windows updates for you (asynchronous). Everything is working except it will popup messages to users.
Like when installing Language Packs it will display the installation for that, and if trying to install Internet Explorer 9 it will popup and ask the user to Accept, Ask me Later, or Don't Install.
Is there a way to hide everything and just install it? I've search through Microsoft's pages on this API and can't find it.
Here is where I perform the install. I didn't include any of the code for the callbacks or downloads because it would a huge post which you all probably wouldn't like lol. If you want me to I can.
public static void Install(UpdateCollection installs)
{
if (installer != null || installs.Count > 0)
{
if (updateSession == null)
updateSession = new UpdateSessionClass();
try
{
installer = updateSession.CreateUpdateInstaller();
installer.Updates = installs;
installer.AllowSourcePrompts = false;
installer.parentWindow = null;
WUInstProgress installProgress = new WUInstProgress();
WUInstCompleted installCompleted = new WUInstCompleted();
installCompleted.InstCompleted += new InstCompletedDelegate(installCompleted_InstCompleted);
installer.BeginInstall(installProgress, installCompleted, null);
}
catch (Exception ex)
{
ReportError(ex.ToString());
}
}
else
ReportLog("Install collection was null or empty");
}
|
|
|
|
|
I don't believe you can control these prompts since they are coming from the component being installed, which you have access to.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
While I can't help you directly, you can bingle SilentInstall for those apps/components if any such options.
Another possible way would be robocopy or the likes. Good Luck.
For instance take a look here or herefor a silent or unattended install of .net framework 4.
They(MS) say it's like this: dotnetfx.exe /q:a /c:"install /q"
Or just search for it yourself. My bingle foo is pretty low.
All the best,
Dan
modified on Wednesday, July 13, 2011 12:57 PM
|
|
|
|
|
But that isn't using the windows update API.
The problem is I'm not exactly sure how or if it is possible to tell using the API which updates require a users input. If it does require a user input I could set it as needed to be manually installed and skip it or fire off another script to manually download the files and run it silently.
|
|
|
|
|
Ahhh I over looked it:
http://msdn.microsoft.com/en-us/library/aa386492(v=VS.85).aspx[^]
Using IUpdateInstaller2 instead of IUpdateInstaller allows you to forcequiet installs. It doesn't hurt to go through all the references again a few times . I will post back if it worked or not....
*Update*
Worked pretty good! The only thing is the updates will still fail if it is unable to install silently. The one I tested was Internet Explorer 9. At least this gives me the ability to filter them out and not have it pending for a users input.
modified on Wednesday, July 13, 2011 10:20 PM
|
|
|
|
|
cool find.
All the best,
Dan
|
|
|
|
|
Hi,
I have C program in which macros are defined as:
#define PORT1 0x378 //basic port address, check this setting in bios
#define DataPort PORT1
#define ControlPort PORT1+2
#define StatusPort PORT1+1
#define _BV(a) (1<<a)
As macros cannot be defined in C# so how can i write these and assign values in c# without making class?? I n c# macros are just with if else condition, declartion and assignment of values cannot be done.I sahll be thankful if any one can help
|
|
|
|
|
Constant values: public const fields, e.g.
class Port {
public const ushort PORT1 = 0x378,
DataPort = PORT1,
ControlPort = PORT1+2;
}
Functional macros: static methods, e.g.
uint BV(int a) { return 1 << a; }
These will get inlined in release mode, generally. Note that you have to specify the type at compile time, so you might need to change how you use them a bit.
Also note that in C#/.Net everything must be in a class. Put constants and static methods in the class for which they're most appropriate.
|
|
|
|
|
If you really want, you can pass your C# code through a C Preprocessor.
|
|
|
|
|
C# compiler does not have a preprocessor. The alternative is to use constants. During lexical analysis stage of compilation, these constants are replaced with their actual values.
|
|
|
|
|
Actually it does (or effectively it does); you can use #define, #if/#endif etc and #pragma. But what it can do is far more limited, and in particular you can not define substitution #defines for constants and macros.
You are right in the context of the question asked here, but there are some preprocessor instructions.
|
|
|
|
|
Technically, C# does not have a preprocessor like C/C++ does, but the #define and #if .. #endif are handled at the lexical analysis stage of compilation. So, it is something like a pseudo-preprocessor.
|
|
|
|
|
aeman wrote: in c# without making class??
My first inclination is to just tell you to give up because it is impossible. Stay with C and forget about using C# (or Java.)
One needs to have an attitude that one must look for solutions (plural) to solve problem rather than insisting that one solution is the only possible avenue. And that is in the context that a 'problem' is a business problem not a technical one.
But additionally, as per the other reply, one can note that the C (and C++) preprocessor is in fact really a 'pre' part of the compilation process and as such it can be run independently from the C/C++ language itself. However your macros are not even close to being complex enough that one should even consider that solution.
|
|
|
|
|
|
hello guys... How can I add a class that is written entirely in C++ (I wrote this class ). I am just experimenting on how to use both C++ and C# at the same time.
|
|
|
|
|
As long as you have Visual C++ installed, you can add your vcproj file as a project. You can't mix and match C++ and C# in the same project, they must exist in different assemblies. Apparently you can, according to the post below. Well, you live and learn.
|
|
|
|
|
A little known fact about the .NET platform is that you can actually mix more than one language in the same assembly, but it has to be a multi-file assembly. Unfortunately, Visual Studio does not support creation of multi-file assemblies, you can only do it through command line tools. This[^] link contains more information.
|
|
|
|
|
Nice. I've just leared something new. Thanks for that.
|
|
|
|
|
|
Thanks for the information ... not something I need right now but it might be useful one day!
|
|
|
|
|
|
Thanks for the information! 5+
|
|
|
|
|
|
overloaded Name wrote: I am just experimenting on how to use both C++ and C# at the same time.
Why?
There are many, many more things in the languages, APIs, and in computing in general that are going to be far, far more useful in terms of spending ones time on it.
|
|
|
|