|
Heath
Thanks for reply..
let me clarify you that Install method has been working fine,as i mentioned in my previous post that i made an assembly dll and associated it with Install Custom action,i now put Uninstall method in same project/assembly where Install method is,for testing i ran InstallUtil utility on my dll and it successfully called both Install and Uninstall method,like
i called Installutil Registry.dll and Installutil /u Registry.dll and they are bringing up respective method properly..
Heath,can you be a bit more elaborative?specially,which CustomAction should I use to call Uinstall method?
Thanks
-A
|
|
|
|
|
Actually, I believe you should elaborate. The way your first post reads seems to say that you had two projects for one installer assembly. And mentioning "CustomAction", I assume you're trying to get an assembly to run from within a Windows Installer project? You didn't mention Windows Installer before. Please be specific in your details of the problem; otherwise, it's difficult to help you.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I am sorry if there was some confusion..let me try to elaborate step by step
1)I added a class library project in my Solution(.sln) and wrote both Overriden versions of Uninstall and Install and built them in form of dll(e.g:mySetup.dll) assembly
2)in the Setup Project,which is also in same solution,i added my mySetup.dll in FileSystem-><i>Application Folder
3)After that i associated that mySetup.dll in Custom Actions(Install and Uninstall) and built the Setup project.
the setup is calling Overriden Install method but not Uninstall method
as you mentioned I assume you're trying to get an assembly to run from within a Windows Installer project?
i think "Yes" because the assembly is called when the Setup.msi file is executed.
Hope i explained a bit better,sorry for my ignorance
-A
|
|
|
|
|
Make sure that for everywhere you use the assembly with the Installer class derivative you have the property "InstallerClass" set to "True". This property can be found in the PropertyGrid when you have your custom action selected.
How are you determining that when you uninstall the MSI package that your Uninstall method isn't executing? Custom actions are difficult to debug (it's one of the things I do at Microsoft), and do keep in mind that the install state files are often left behind.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Heath Stewart wrote:
Make sure that for everywhere you use the assembly with the Installer class derivative you have the property "InstallerClass" set to "True". This property can be found in the PropertyGrid when you have your custom action selected.
this class` InstallerClass property is true thatswhy it prompts a MessageBox which i had added for testing
Heath Stewart wrote:
How are you determining that when you uninstall the MSI package that your Uninstall method isn't executing?
i added a messageBox ,like i did in Install class but unlike Install method,its not coming up..
Heath Stewart wrote:
Custom actions are difficult to debug (it's one of the things I do at Microsoft), and do keep in mind that the install state files are often left behind.
yes here you seem right because when i remove prorgram,it doesn`t remove program folder,my Installer assembly(mySetup.dll as i mentioned in last post) and ALL assemblies which are used to run my application
though i set Permenant propety of all classes to True but still it never wipes out everything at all..
i had been going thru some usenet disucssions thread and the guys were talking
about using Orca utility to read MSI file or using MsiExec but i coudn`t understand them..
-adnan
|
|
|
|
|
Ok,i tried the setup on Enduser PC and there it called the Uninstall method,
as Heath said,it could because dlls installed on my machines were due to Gacutil and Regasm rather than by using Setup itself ..
but i am not sure about this because the guy who tested my application said that he stil finds assemblies in GAC which are supposed to be removed upon Uninstallation
hOwever,it throws an exception as well..
got an exception occured while unistalling, this exception will be ignored and the unistall will continue. However the application might not be fully unistalled after the uninstall is complete --> object refereance not set to an instance of an object
my code is given below:
public override void Uninstall(System.Collections.IDictionary savedState)
{
MessageBox.Show("File is Deleted during Uninstall","Uninstall Phase");
//Remove XML FIle
if(File.Exists("c:\\_config.xml"))
{
File.SetAttributes("c:\\_config.xml",FileAttributes.Normal);
File.Delete("c:\\_config.xml");
MessageBox.Show("Existed File is Deleted","Config File Uninstallation");
}
base.Uninstall(savedState);
RegistrationServices regsrv=new RegistrationServices();
if (!regsrv.UnregisterAssembly(this.GetType().Assembly))
{
throw new InstallException("Failed To Unregister for COM");
}
}
please keep in mind tht code is throwing Un-handled Exception which i mentioned above..
and I dont know how to debug all this:
Thanks
-adnan
|
|
|
|
|
As someone who works on patches for the .NET Framework, let me assure you that the GAC support in MSI does not always work. You'd be better off using custom actions to install into and uninstall from the GAC.
Using Orca is something I do practically every day, but unless you're familiar with MSI it wouldn't really help. Making sure your MSI package is authored correctly is the first step. You should not be using regasm.exe or gacutil.exe in your custom actions because the latter isn't even installed with the .NET Framework (but in the SDK), unless you carry them in your payload and that, too, is not recommended. Everything regasm.exe and gacutil.exe do you can do using installer classes, which you appear to be doing, at least, for component registration.
On that note, make sure that you fix your clases and interfaces with a unique GuidAttribute value, and that you do NOT use auto-generated classes interfaces. Define your interfaces explicitly so that changes in method and property order to not screw-up eary- (VTBL) or late-binding (dispatch IDs) clients. Also never change a published interfaces. I've been developing OLE and COM controls for as long as I can remember and .NET/COM interop is my forté.
If you don't fix your GuidAttribute s for classes and interfaces, when you register new assemblies (or unregister the old using the new assemblies) the registry will not be cleaned up.
Read Exposing .NET Components to COM[^] for more details.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello:
I’ve a web form containing a web user control and a place holder, this web user control have 2 buttons, when user push 1st button I’m loading a 2nd web user control into place holder of web form. When user push 2nd button of 1st web user control I destroy 2nd web user control and place into place holder a 3rd web user control.
This last web user control has a button, several text box and a label. When user puh button I need to show soemthing into label, but when user push button, this web user control simply vanish.
If I recreate web user control programatically I have not way to recover data into textbox and into label.
I’ll appreciate some ideas to attain it.
A.L.
|
|
|
|
|
Try the ASP.NET[^] forum. I know that your question has been asked and answered before, so be sure to search the forum first by click "Search comments" directly above the message board.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
hi,
i am planning a project where i need to play videos as textures on simple 3d surfaces!
i know this is possible with direct3d and vmr9! but are these available with c#??
i know direct3d is available via managed directx but is vmr9???
if not, is it possible to use unmanaged direct3d and vmr9 with c#??
i have googled a lot but i couldn't find any answer!
by the way, where can i read about the exact limits of managed directx vs unmanaged in c#??
thx & greets
matthias
|
|
|
|
|
I'm not sure what VMR9 is, but you can learn more about Managed DirectX 9 at http://msdn.microsoft.com/directx[^], as well as download the SDK.
Apparently your search was too restrictive. Always start off with basic terms. There are many DirectX articles involving P/Invoking and writing RCWs (Runtime Callable Wrappers) in C# for use in .NET here on Code Project which is indexed by all the major search engines (and then some).
Just use the text box at the top of every page underneath the logo for a direct approach to searching the site, though. Try starting with, quite simply, "DirectX".
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
VMR9 = Video Mixing Renderer 9 (part of directshow, but can also be used as texture at dx3d)
i have read a lot at msdn...but it didn't help! for example: there is no information about what can and what cant be done using managed vs unmanaged dx!! the only thing i know, is that managed dx is about 2-5% slower than unmanaged....i can live with that! but what about the vmr9...i have read at an article posted 2002 that it was not available in managed dx...but now we have 2005!! is there any updates on that??
i already have the dx9 sdk...but the documentation seems to be focused on c++!
i have to take a decition wheather to use c# for my project or to learn c++ !! sorry, but all i read at msdn seems like marketing bla bla to me!!
|
|
|
|
|
Actually there's quite a bit of information on MSDN about the differences, like the article Introducing the New Managed Direct3D Graphics API in the .NET Framework[^]. The biggest difference between using your own interop assembly and using Managed DirectX 9.0 is that Managed DirectX is written from the ground up to be much more friendly for .NET development. Using a simple interop assembly often means you have to add a lot of extra code - similar to your unmanaged C++ code - to make anything happen. That's the power of encapsulation. The performance loss would be about the same whether you used Managed DirectX vs. a native DirectX interop assembly/assemblies (which you can find several implementations of here on Code Project).
Unfortunately not everything was added to Managed DirectX, like DirectShow. The nice thing is - depending on how you look at it - Managed DirectX 9 can work seemlessly with native DirectX. You can still pass pointers (in the form of IntPtr s) to many methods as alternatives, and some methods and properties will even return you a pointer to native interfaces. With this in mind, you may have to interop VMR9 (which may already be done for you in one of the DirectX wrappers here on Code Project, or may at least give you some ideas for doing it).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
does that mean that i could allocate an unmanaged vmr9 surface to an managed 3d device?
|
|
|
|
|
Most likely, but as I said I'm not familiar with VMR9 and was not able to find anything about it in the unmanaged DirectX 9.0 SDK. I recommend going to the public newsgroup microsoft.public.win32.programmer.directx.managed[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I have a problem which I can't enable an UI control such as a text box in System.Threading.Timer times out.
TextBox1.Enabled = false;
System.Threading.TimerCallback tmrCB = new System.Threading.TimerCallback( this.Timer1 );
System.Threading.Timer m_UITimer = new System.Threading.Timer(tmrCB, 0, 500, System.Threading.Timeout.Infinite );
private void Timer1(object state)
{
TextBox1.Enabled = true;
}
After 0.5 second timeout, the TextBox1 is still disabled. Does there has anyway to enable a TextBox or any UI Control in a System Timer thread. I tested in Windows form and it works fine, but it doestn't work in Web Form. Does someone can help can give me an advice how make it work in Web Form.
Thanks a lot.
|
|
|
|
|
|
That is a good advice. I am doing web client side user interface design, so I can't use System.Windows.Forms.Timer. Does there have some limitation to control the UI in timer or different thread?
Thanks a lot!!
|
|
|
|
|
Hello,
I'm having an odd build error. When I build my project, I get two build errors. Both of them say "Post Build Event Failed". When I run the project afterward, I only get one of these errors. When I run it again, I don't get any and the application loads perfectly.
I have a group of five projects in a VS.NET solution. One project is a Winforms executable that directly references two dlls. One dll is just a class library, while the other one contains a couple of classes and two or three controls. Both dlls are (should be) installed to the GAC using gacutil /i /f. The library with the controls directly references the library that just contains classes. There is also another executable in the project that directly references both dlls.
Finally, there is another dll which is dynamically loaded by the first executable. In the current design, it resides in a folder under the path of the executable. The executable knows where to find the files. I will be adding more dlls later.
My code is all working and I'm just trying to swat a few last minute bugs before it goes to QA. I'm getting a message in the output window saying the following:
'gacutil' is not recognized as an internal or external command,
operable program or batch file.
Project error: A tool returned an error code from the build event
How do I fix this? It's getting old.
Will
|
|
|
|
|
gacutil.exe must be in your path and you must have installed the .NET Framework SDK. By default this is installed with VS.NET.
To add this to your PATH environment variable, right-click on "My Computer", select Properties, click the Advanced tab, and select environment variables. I recommend adding this to the system environment variables toward the end (after the various %WINDIR% directories).
Add the following to your PATH environment variable (separated by semi-colons):
%WINDIR%\Microsoft.NET\Framework\v1.1.4322 Use whichever .NET verison is appropriate. The above is for .NET 1.1, of course.
You must restart VS.NET for this change to take effect. You could also specify the following for your post build action instead of just "gacutil.exe":
$(WINDIR)\Microsoft.NET\Framework\v1.1.4322 The larger problem is, why are you installing your projects you're working on in the GAC? The GAC is for runtime assemblies only - not for building against (which is why both the .NET Framework BCL assemblies and third-party assemblies install both into a private version directory as well as into the GAC). If you're solution includes multiple projects, use a project reference instead of a file reference. This means that when you use the Add Reference dialog for your project, you click on the Project tab and add your project. Not only does this keep your assemblies up-to-date by establising build dependencies, but it also makes sure that if you're using automatic versioning (using an asterisk in your AssemblyVersionAttributE , which isn't recommended for most projects) your assemblies with that dependency will build against the right version since version numbers matters very much for managed assemblies (as opposed to most native libraries).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
The main reason that I'm installing these two assemblies to the GAC is that there is a dll that is loaded dynamically by my application that references them. The main application also references them, as does a secondary application. I figured the GAC would be the best place to put them so that the same assembly would load in all cases. This is also how I intend to install it on the client. Is there a better way?
Will
|
|
|
|
|
When you're developing your projects you should not use the GAC. Chances are you'll be compiling a lot and if you use automatic versioning (which I strong warn you about because it can cause so many versioning problems, especially with late-bound dependencies) - which means you have an asterisk in your AssemblyVersionAttribute - your GAC will become cluttered very quickly.
You could - for purposes of developing - add those projects to as dependencies of your application project. If these are all in the same solution, use the Project tab to establish a build dependency (especially handy when you use automatic versioning). If they are not in the same solution, add them as assemblies. In the PropertyGrid make sure they are copied locally. Note that unless you use a Type defined in one of those assemblies, the compiler will not link them as dependent assemblies (so they will not be referenced in your assemblies' manifests). This will, however, copy them locally. An application will attempt to use assemblies in the application directory or a probing path (like ASP.NET's bin sub-directory), or another location configured in its .config file. The GAC is one of the last places the CLR will look to locate assemblies.
Read How the Runtime Locates Assemblies[^] for more information.
And on a somewhat-related note, to read one reason why (implied) automatic versioning is bad, read about how you can improve your clients' upgrade experience by deploying publisher policies that allow older code (which references older Types) to use new Types (with a newer version). Read Redirect Assembly Versions[^] and Creating a Publisher Policy[^] in the .NET Framework SDK.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I'm actually wanting it to probe for the assemblies in a folder below the application's root. The user actually picks which one(s) they want to load. The assembly is then loaded into another AppDomain. All interaction with that assembly occurs through a class in a library that both assemblies reference. The common dll is loaded into the AppDomain just before I load whatever dynamic assembly I'm using. In a development situation, could I get away with copying the common dll into the path so that it will be found when the other dll is loaded dynamically (since the dynamically loaded dll references it)?
Then, we I deploy the application, I could still throw my common dll into the GAC, right?
On the plus side, I'm not using automatic versioning, as the there is only a single instance of each assembly that I'm putting into the GAC in my Assembly folder (unless I'm not understanding correctly).
|
|
|
|
|
In the documentation I linked, you can specify a sub-directory using the <probing> element in your application's .config file:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="plugins"/>
</assemblyBinding>
</runtime>
</configuration> Your .config file is named the same as your application with .config appended and located in the same application directory. For example, myapp.exe.config.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I use an XML file layout the steps to be completed by the program. Here is the general idea of the XML file:
<?xml version="1.0"?>
<DOC Name="TEST">
<STEP NAME="My Step 1" ID="1" TYPE="Type1">
<BLOCK NAME="TestBlock_1_1" NUMBER="68"></BLOCK>
<BLOCK NAME="TestBlock_1_2" NUMBER="35"></BLOCK>
</STEP>
<STEP NAME="My step 2" ID="2" TYPE="Type2">
<BLOCK NAME="TestBlock_2_1" NUMBER="42"></BLOCK>
<BLOCK NAME="TestBlock_2_2" NUMBER="26"></BLOCK>
</STEP>
</DOC>
I am reading the file fine, and can parse through and work with the STEP Elements. What I cannot get working is accessing the BLOCK elements within only a particular STEP
if(reader.Name=="STEP") //
{
reader.MoveToAttribute("NAME");
if(reader.Value == "My Step 1")
{
// How do I move to the Elements within this step??
// I need to know the BLOCK values
}
}
Thanks in advance for the help.
|
|
|
|
|