Author Topic: [NSIS] How to check if AutoCAD is running and locking my files?  (Read 2287 times)

0 Members and 1 Guest are viewing this topic.

simor

  • Guest
[NSIS] How to check if AutoCAD is running and locking my files?
« on: October 17, 2008, 08:04:22 AM »
I'm doing an NSIS installer and want to check if AutoCAD (2008) is running. I was trying to use FindWindow but it seems that AutoCAD's window has a variable class name..

Code: [Select]
Afx:00400000:8:00010011:00000000:xxxxxxxx
The last part is changing at every startup so I can't use it. I tried googling it, found this:
http://mail.python.org/pipermail/python-win32/2007-February/005559.html
Unfortunately I think he was guessing because I couldn't confirm his theory with the parent class name.

Trying to find acad.exe in running processes is a bit messy under NSIS, haven't tried it yet and I'm not sure that I can find the window caption by process. Will be investigating this...

I don't want to go through all open windows checking their class name and caption nor trying to rename acad.exe to find if its locked or not :ugly:

Any ideas?
« Last Edit: October 20, 2008, 05:29:56 AM by simor »

TonyT

  • Guest
Re: How to check if AutoCAD is running?
« Reply #1 on: October 18, 2008, 08:33:49 AM »

FengK

  • Guest
Re: How to check if AutoCAD is running?
« Reply #2 on: October 18, 2008, 06:33:49 PM »
Google for AutoItX, a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. It has a "ProcessExists" method.
http://www.autoitscript.com/autoit3/docs/functions/ProcessExists.htm

simor

  • Guest
Re: How to check if AutoCAD is running?
« Reply #3 on: October 19, 2008, 09:52:56 AM »
   COM ?

I'm not sure how to do that in NSIS.. if it's even possible, I didn't find any mention of COMs in the manual :| but it would be some solution...

Google for AutoItX, a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. It has a "ProcessExists" method.
http://www.autoitscript.com/autoit3/docs/functions/ProcessExists.htm

I mentioned search for the process (eg. using this) but if I find acad.exe I won't know if it's AutoCAD 2008 or a different one... right (?)



simor

  • Guest
Re: How to check if AutoCAD is running?
« Reply #4 on: October 20, 2008, 05:27:18 AM »
I ended up with two solutions, I found a script to look for variable window class names which requires one simple change and can look for variable window captions.. but the second solution is way better: LockedList plug-in. First you feed it with names of files and then it checks if they are in use by any running application and lists those apps in a listbox. Which is really what I was after..
Cool or what..  ^-^