Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Deployment problems. AutoitX, C# .NET 2005, Visual studio settings?


  • Please log in to reply
20 replies to this topic

#1 luddet

luddet

    Seeker

  • New Members
  • 4 posts

Posted 07 February 2006 - 04:41 PM

I'm developing an application which makes use of the AutoitX dll. In my Visual Studio 2005 C# project I add a reference to the AutoItX3.dll and all is fine and dandy.
Everything works on my development machine where I also have AutoIt installed.

Now I create a Visual Studio setup project and it detects the dependency of AutoItX3.dll and Interop.AutoItX3Lib.dll.

And this is where I get the problem. How should I set the settings for the reference and dependencies?
The defaults are:
Reference in main project->AutoItXLib - Isolated: False
Dependency in setup->AutoItX3.dll - Register: vsdrfDoNotRegister
Dependency in setup->Interop.AutoItX3Libb.dll - Register: vsdraDoNotRegister
If I leave them at the default values the application doesn't work on a computer that doesn't have autoit installed. I get this error message:
"Retrieving the COM class factory for component with CLSID {1A671297-FA74-4422-80FA-6C5D8CE4DE04} failed due to the following error: 80040154."

Now I change the settings to:
Dependency in setup->AutoItX3.dll - Register: vsdrfCOMSelfReg
Dependency in setup->Interop.AutoItX3Libb.dll - Register: vsdraCOMRelativePath
This will work even on a computer that doesn't have autoit installed, but it brings another problem instead.
If the computer has autoit installed and I then uninstall it after installing my application, my application stops working.

I'm assuming that this is because autoit removes the registration of the specific guid associated with the autoit dll when it is uninstalled without knowing that my application is using the same guid.

I hope I have made my problem clear enough.

So the big question is of course, how can I prevent this uninstallation problem from happening?

thanks
/luddet

Edited by luddet, 07 February 2006 - 04:42 PM.








#2 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 07 February 2006 - 11:22 PM

maby you could register it yourself evry time you start the application.
My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

#3 luddet

luddet

    Seeker

  • New Members
  • 4 posts

Posted 07 February 2006 - 11:50 PM

maby you could register it yourself evry time you start the application.


One would think there must be a simpler way...

#4 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 10,298 posts

Posted 08 February 2006 - 02:19 AM

Maybe you could call it as a DLL, not a COM? Then it wouldn't need to be registered, just in one of Windows' search directories. PATH/currentdir/etc

#5 luddet

luddet

    Seeker

  • New Members
  • 4 posts

Posted 08 February 2006 - 03:40 AM

Maybe you could call it as a DLL, not a COM? Then it wouldn't need to be registered, just in one of Windows' search directories. PATH/currentdir/etc


That would probably work. But I don't know how to do that. Do you? Or anyone else here?

#6 Zach

Zach

    Wayfarer

  • Active Members
  • Pip
  • 68 posts

Posted 08 February 2006 - 02:21 PM

One would think there must be a simpler way...



It is not a bad idea to register you files every time your application starts irregardless - depending on how many external, 3rd party dlls or ocxs you are using (if any other than AutoIt) - some companies/individuals have a bad habit of when they do updates not changing the CLSID - though the component might have breaking changes in it.

By re-registering your needed files at run time - you insure that if that situation does happen - you at least have the files you need when the program started

#7 luddet

luddet

    Seeker

  • New Members
  • 4 posts

Posted 21 February 2006 - 09:19 PM

It is not a bad idea to register you files every time your application starts irregardless - depending on how many external, 3rd party dlls or ocxs you are using (if any other than AutoIt) - some companies/individuals have a bad habit of when they do updates not changing the CLSID - though the component might have breaking changes in it.

By re-registering your needed files at run time - you insure that if that situation does happen - you at least have the files you need when the program started

How would I do this? And could there be any drawbacks?

I was also thinking about perhaps using [DllImport("AutoItx3.dll")] in some way, but I don't know how to import a whole class this way.

#8 ramadash

ramadash

    Wayfarer

  • Active Members
  • Pip
  • 70 posts

Posted 12 March 2006 - 05:56 AM

I think you forget to add the reference to the autoit type library. I add the same (or similar) problem when making my .net autoitx wrapper. In your description you are only adding one reference to autoitx, wich if it is true, is not enough.

first of all you need to add->reference->projects, the browse to your autoit dll (wich is probably what you already done). Once that is done, vs.net will create Interop.Autoit3x.dll. when this is done your need to add another reference but this time in add->reference->COM, select browse, and reference your newly created Interop.Autoitx.dll file. This worked for me, and once vs.net register it you will see autoit type library on the list when you click on COM.

#9 flaxcrack

flaxcrack

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 277 posts

Posted 13 March 2006 - 04:21 PM

I'm developing an application which makes use of the AutoitX dll. In my Visual Studio 2005 C# project I add a reference to the AutoItX3.dll and all is fine and dandy.
Everything works on my development machine where I also have AutoIt installed.

Now I create a Visual Studio setup project and it detects the dependency of AutoItX3.dll and Interop.AutoItX3Lib.dll.

And this is where I get the problem. How should I set the settings for the reference and dependencies?
The defaults are:
Reference in main project->AutoItXLib - Isolated: False
Dependency in setup->AutoItX3.dll - Register: vsdrfDoNotRegister
Dependency in setup->Interop.AutoItX3Libb.dll - Register: vsdraDoNotRegister
If I leave them at the default values the application doesn't work on a computer that doesn't have autoit installed. I get this error message:
"Retrieving the COM class factory for component with CLSID {1A671297-FA74-4422-80FA-6C5D8CE4DE04} failed due to the following error: 80040154."

Now I change the settings to:
Dependency in setup->AutoItX3.dll - Register: vsdrfCOMSelfReg
Dependency in setup->Interop.AutoItX3Libb.dll - Register: vsdraCOMRelativePath
This will work even on a computer that doesn't have autoit installed, but it brings another problem instead.
If the computer has autoit installed and I then uninstall it after installing my application, my application stops working.

I'm assuming that this is because autoit removes the registration of the specific guid associated with the autoit dll when it is uninstalled without knowing that my application is using the same guid.

I hope I have made my problem clear enough.

So the big question is of course, how can I prevent this uninstallation problem from happening?

thanks
/luddet


Did you make sure that the property of the Local Copy of the Reference read as true. I have gotten it to work. See my screen shot.

Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post

I made this: FWD & MD5PWD()

#10 flaxcrack

flaxcrack

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 277 posts

Posted 13 March 2006 - 04:37 PM

Did you make sure that the property of the Local Copy of the Reference read as true. I have gotten it to work. See my screen shot.


I'm sure you also want it to be bundeled for deployment sake too. What is your method of deployment?

Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post

I made this: FWD & MD5PWD()

#11 darkxiii_ndp

darkxiii_ndp

    Seeker

  • New Members
  • 4 posts

Posted 01 May 2006 - 02:17 PM

Using RegFree COM, you can deploy an application that uses a COM component without registering it on the user's machine, thus avoiding the notorius collection of problems commonly referred to as "DLL Hell." RegFree COM even allows you to run multiple versions of a COM component on the same machine.

RegFree COM works by automatically generating a manifest from the COM component's type library and component registration on the developer's machine. Therefore, while it is not required to install the component on the end users' machines, a copy must be registered on the developer's machine.

To enable use of RegFree COM, all COM components referenced in Visual Studio 2005 now have a new Isolated property. If you set Isolated to true, the component can be deployed through ClickOnce, and Visual Studio 2005 will automatically do all the work to deploy the COM component onto the target machine (without needing to register it on the target machine).

Posted Image

#12 Insolence

Insolence

    Not distastefully arrogant

  • Active Members
  • PipPipPipPipPipPip
  • 1,304 posts

Posted 10 December 2006 - 05:13 PM

When I try to set "Isolated" to true, I get this exception:

"System.ArgumentNullException was unhandled
Message="Value cannot be null.\r\nParameter name: activationContext"
Source="mscorlib"
ParamName="activationContext"
StackTrace:
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[]activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()"

EDIT:
I don't know what I changed, but now it at least runs fine with debugging, but when I release and execute it without a I get an unhandled exception.

Edited by Insolence, 10 December 2006 - 08:55 PM.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

#13 daluu

daluu

    Wayfarer

  • Active Members
  • Pip
  • 81 posts

Posted 15 September 2008 - 04:25 AM

See also related post on how to use AutoIt as C++ DLL and not a COM DLL

http://www.autoitscript.com/forum/index.php?showtopic=72905

Edited by daluu, 15 September 2008 - 04:26 AM.


#14 jcddcjjcd

jcddcjjcd

    Seeker

  • Active Members
  • 30 posts

Posted 29 September 2008 - 05:19 AM

The previous link refers to a post of mine. I can see where you are coming from, the use of the Autoit COM object is very appealing but I never got it to work in a satisfactory way when deploying to other machines. The RegFree approach does not work well for AutoIt and when you read all the MS documentation about RegFree you can see that is not a solution for every case. That is why I took the trouble to provide the examples of using all of the dll functions via C# calls.
Thanks to AutoIt for providing the dll version and I hope that always will be so.
Regards,
John.

#15 amokoura

amokoura

    AutoIt fanatic

  • Active Members
  • PipPipPipPipPipPip
  • 315 posts

Posted 29 September 2008 - 09:28 AM

...
The RegFree approach does not work well for AutoIt..
...


Does this help at all?: RegFreeCOM Au3X Example, Use RegFree to Solve DLL Hell, Even With COM Clients

#16 jcddcjjcd

jcddcjjcd

    Seeker

  • Active Members
  • 30 posts

Posted 30 September 2008 - 06:20 AM

Does this help at all?: RegFreeCOM Au3X Example, Use RegFree to Solve DLL Hell, Even With COM Clients


It is true that the example above does work, I tried it way back and again today. It would be great if the source files were made available so we can see how it was done. I spent a couple of days with settings in VS but never got it to work reliably in my apps. The source may provide the answer. Perhaps the manifest was made manually rather than using the MS suggestion of letting VS do the work.
Regards,
John.

#17 jcddcjjcd

jcddcjjcd

    Seeker

  • Active Members
  • 30 posts

Posted 01 October 2008 - 03:39 AM

Well I looked at the source and it just shows the standard way of doing it. Very simple really. I still get problems though when I use it in my own ClickOnce deployments. Particularly errors stating that the assemblies need to be strong signed. Using the dll with dllImport still gives the same functionality but with no deployment issues.
Regards,
John.

#18 amokoura

amokoura

    AutoIt fanatic

  • Active Members
  • PipPipPipPipPipPip
  • 315 posts

Posted 01 October 2008 - 08:06 AM

Thank you for sharing your experiences.
I was really attracted to the regree solution and was about to use it.
Seems that the best approach is to use the plain dll.
At least then I wouldn't have to struggle with the same problems as you have been fighting with..

#19 evlo

evlo

    Seeker

  • Active Members
  • 7 posts

Posted 11 July 2011 - 02:04 AM

Can you please help me how to make app work without need to register the dll usin regsvr32?

When i tried to set isolated=true and enable interop types = false i get this error:
Unable to cast COM object of type 'AutoItX3Lib.AutoItX3Class' to interface type 'AutoItX3Lib.IAutoItX3'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3D54C6B8-D283-40E0-8FAB-C97F05947EE8}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

When i tried to set isolated=true and enable interop types = true i get this error:
Unable to cast COM object of type 'System.__ComObject' to interface type 'AutoItX3Lib.AutoItX3'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3D54C6B8-D283-40E0-8FAB-C97F05947EE8}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).


With isolted=false i get classic
Retrieving the COM class factory for component with CLSID {1A671297-FA74-4422-80FA-6C5D8CE4DE04} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Edited by evlo, 11 July 2011 - 02:10 AM.


#20 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 12,271 posts

Posted 11 July 2011 - 02:58 AM

You couls always use the dll directly instead of using COM.

AutoIt Absolute Beginners Require a serial
 
 
OMG! Women are the cows of people.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users