![]() |
#1 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
LockedList plug-in
An NSIS plugin to display or get a list of programs that are locking a selection of files that have to be uninstalled or overwritten.
http://nsis.sf.net/File:LockedList.zip Stu |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
v0.2 - 11th July 2007
* Better percent complete indication. Stu |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: May 2007
Posts: 40
|
Hi Afrow UK,
Even simple script LockedList::AddFile /NOUNLOAD $SYSDIR\kernel32.dll" LockedList::Dialog doesn't work for me. I get messages "Going to compile test program and then run it" then "The file '$TEMP\nsz1325.tmp\Lock' is now locked. It will appear on the LockedList dialog page soon..." some dialog blinks and that's all. The same result I've got with example provided with plugin. |
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Firstly, you're missing a quote and secondly that's a module not a file.
How about this script: code: You'll get some garbage for the first program captions. I might be able to fix this. Stu |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: May 2007
Posts: 40
|
Thank you for sample but it also doen't work for me.
It seems that the problem is exactly in LockedList::Dialog I modified your sample adding three message boxes code: and I can see only two of them. |
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You're not going to see the 3rd one because the dialog stops execution of the installer until it is closed.
What exactly happens? Does the dialog not display? Edit: Also, what OS are you on? Stu |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: May 2007
Posts: 40
|
dialog doesn't appear. installer is closed after message box "test2" closed.
OS: WinXP SP2 |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
That's interesting. I'm running Win XP SP2 also.
What happens if you don't use any AddFile/AddModules. Stu |
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: May 2007
Posts: 40
|
ok, sorry for delay with answer. I had to deal with something.
now I'm sure that the problem is in LockedList::Dialog I have two vesions of script code: and code: the first one shows message boxes "test3" "test1" "test2" the second one "test1" "test2" diff: !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_INSTFILES Page Custom LockedListShow !insertmacro MUI_PAGE_WELCOME Page Custom LockedListShow !insertmacro MUI_PAGE_INSTFILES we contact directly so I can help you debug plugin Last edited by daisywheel; 12th July 2007 at 15:18. |
![]() |
![]() |
![]() |
#10 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I'm aware that it is the plugin yes.
My MSN is afrowuk at tiscali dot co dot uk Stu |
![]() |
![]() |
![]() |
#11 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Located the problem thanks to daisywheel
![]() Please be patient while we make sure everything is ok then I shall upload the updated version. Stu |
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
|
![]() |
![]() |
![]() |
#13 |
Junior Member
Join Date: May 2007
Posts: 40
|
LockedList::AddModule /NOUNLOAD "$SYSDIR\module.dll"
LockedList::AddModule /NOUNLOAD "$SYSDIR\kernel32.dll" in case file module.dll doesn't exist will result error in functionality - there will no dependencies found in case we change order LockedList::AddModule /NOUNLOAD "$SYSDIR\kernel32.dll" LockedList::AddModule /NOUNLOAD "$SYSDIR\module.dll" plugin will work in another manner. I don't think this is expected behaviour. |
![]() |
![]() |
![]() |
#14 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Found the problem. It was a bad array pointer. It wasn't the fact of the file not being there it was simply only taking the first file or module added with AddFile/AddModule.
I was also able to fix the captions problem. I noticed captions were being repeated over multiple processes aside from the garbage caption for the first few processes. Just needed a ZeroMemory in there. Uploaded v0.2 RC3. http://nsis.sf.net/File:LockedList.zip Thanks again ![]() Stu |
![]() |
![]() |
![]() |
#15 |
Junior Member
Join Date: May 2007
Posts: 40
|
One more suggestion. I'm not compeltely happy with results.
For example, I have two browser application run: Internet Explorer and Moxilla Firefox both on page http://nsis.sourceforge.net/File:LockedList.zip also I use following code in a script code: and as results I've got WINAMP.COM | Forums - LockedList plug-in - Moxilla Firefox (firefox.exe) for Moxilla Firefox and AutoSuggest Drop-Down (iexplore.exe) for IE |
![]() |
![]() |
![]() |
#16 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Currently it grabs the first window caption for that process id by using EnumWindows. I'll look into it. Maybe I can check if the window is a child or not and if it is then skip it.
Stu |
![]() |
![]() |
![]() |
#17 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Realised that EnumWindows does not enumerate child windows anyway (that's what EnumChildWindows is for) so instead I'm checking to see if a window has the WS_SYSMENU style set (title bar). Now get the correct caption for Internet Explorer among others.
Uploaded v0.3: http://nsis.sourceforge.net/File:LockedList.zip I also documented the ::Unload function which has to be used to unload the plugin after calling SilentWait /NOUNLOAD /time #. Few other changes in the change log too. Stu |
![]() |
![]() |
![]() |
#18 |
Junior Member
Join Date: May 2007
Posts: 40
|
Another suggestion.
Add horizontal scroll when long name is displayed. For now horizontal scroll is added only together with vertical one (in some cases even when it's not necessary) Roman |
![]() |
![]() |
![]() |
#19 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
This isn't possible because the list box is actually a list view with a single hidden column set to the width of the box. The NSIS InstFiles page has the same thing. Another option would be to have a tool-tip like the InstFiles page...
Stu |
![]() |
![]() |
![]() |
#20 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
You can use ListView_SetColumnWidth with LVSCW_AUTOSIZE, but I think the triple dot looks better. If someone wants to see the entire line, he could just hover over it instead of scrolling and then seeing just the end.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#21 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Yeh I agree.
How does NSIS work out how long the text being displayed is? I'm guessing it's not just down to the number of characters... Stu |
![]() |
![]() |
![]() |
#22 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Size of the list view minus the size of a scroll bar. Line 1568 of Source\exehead\ui.c.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#23 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Yeh I've got that already... sorry meant the dots, but now I'm guessing that the list view control adds those itself anyway!!
Stu |
![]() |
![]() |
![]() |
#24 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
The list view automatically shows the dots, but you need LVS_EX_LABELTIP for it to show the tool tip.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#25 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Thanks found that in Ui.c too. Very neat that it's all provided
![]() Uploaded v0.3 RC2: http://nsis.sourceforge.net/File:LockedList.zip Edit: Uploaded again as it had the test executable in the Zip (+50000 bytes or so) Stu |
![]() |
![]() |
![]() |
#26 |
Senior Member
Join Date: Aug 2007
Location: Paris, France
Posts: 304
|
Nice plugin and sources
![]() Thanks ! |
![]() |
![]() |
![]() |
#27 |
Senior Member
Join Date: May 2007
Location: Maple Grove, Minnesota
Posts: 134
|
During testing of various locked items, I found a minor quirk. The locking process was detected going away for the exe's, but when I exited explore (brought up inside the target install directory), that was not detected going away. I had to navigate back and then next again to repeat the locked file search to get past it to the install. Also during testing, I ran into an "out of memory" message that appeared in the dialog just before the process name. That only happened once and did not repeat itself during futher testing.
|
![]() |
![]() |
![]() |
#28 |
Junior Member
Join Date: Jan 2006
Posts: 22
|
Paths
It appears that the plugin doesn't try both short and long paths so both need to be added for files / modules that may be in use with either a long or short path. Might be a nice addition for the plugin to check both behind the scenes.
Better still would be the ability to match files / modules in use by file name and then compare the paths to verify they are the same. This would also cover the unlikely scenario where the path is a combination of both long and short. Also, files / modules names can be short. Besides that all I can say is wow... this is an extremely useful plugin. Thanks, Robert |
![]() |
![]() |
![]() |
#29 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Ah right good find. I'll see what I can do about that when I've got some time.
I plan on adding a 'file name only' lookup for the plug-in as well, and also the ability to simply show windows that have the task bar style set. Thanks Stu |
![]() |
![]() |
![]() |
#30 |
Junior Member
Join Date: Jan 2006
Posts: 22
|
SilentSearch
I just noticed that SilentSearch isn't working when the module is in use by another user. This is on Vista with fast user switching. Interestingly enough, LockedList:
![]() Thanks again, Robert |
![]() |
![]() |
![]() |
#31 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I shall see if I can reproduce this on my XP machine soon. I do not have Vista unfortunately. This is interesting though as they are both exactly the same code bases for both functions except one directs output to the stack and one to a list view control!
Stu |
![]() |
![]() |
![]() |
#32 |
Junior Member
Join Date: Jan 2006
Posts: 22
|
After a quick peruse of the code it appears that EnableDebugPriv is only called when using the internal ui (e.g. LoadDialog).
*edit* that is the problem Last edited by RobertStrong; 15th September 2007 at 02:33. |
![]() |
![]() |
![]() |
#33 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Oh right woops :S
Stu |
![]() |
![]() |
![]() |
#34 |
Senior Member
Join Date: May 2007
Location: Maple Grove, Minnesota
Posts: 134
|
LockedList Plug-in:
The accelerator keys do not work for the next/back buttons. Only the mouse works. |
![]() |
![]() |
![]() |
#35 |
Senior Member
Join Date: May 2007
Location: Maple Grove, Minnesota
Posts: 134
|
Our tester has been experiancing an intermitant crash in the LockedList.dll plug-in. The crash happens during initialization (dialog is showing 0% on progress) The image captures is too large to attach. Here is the script used:
; ; This function is called to display any locked files. ; Function LockedListShow ;Creator function !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLElock)" "$(TEXT_IO_SUBTITLE2)" LockedList::AddFile /NOUNLOAD "$INSTDIR\${PRODUCT_NAME}" LockedList::AddModule /NOUNLOAD "$INSTDIR\${PRODUCT_NAME}\${PRODUCT_LAUNCHER_EXE}" LockedList: ![]() FunctionEnd Here is the crash information: LockedList.map 0001:00001891 ?EnumSystemModules@@YGHP6GHUFILE_INFORMATION@@J@ZJ@Z 10002891 f SystemEnum.obj 0001:00001a97 ?EnumProcessIds@@YGHP6GHKJ@ZJ@Z 10002a97 f SystemEnum.obj offset from error signature: 000029b5 base of EnumSystemModules: 2891 ------------------------------------- 124 relative --> Line 478 SystemEnum.asm ; 476 : ; 477 : // Get the file path of the module. ; 478 : if (GetModuleFileNameEx(hProcess, hModules[j], File.FullPath, MAX_PATH)) push 260 ; 00000104H mov eax, DWORD PTR [eax] mov DWORD PTR _File$54859[ebp], eax lea eax, DWORD PTR _File$54859[ebp+4] push eax mov eax, DWORD PTR -24+[ebp] push DWORD PTR [eax] push esi call DWORD PTR _GetModuleFileNameEx test eax, eax je SHORT $L54877 SystemEnum.cod ; Line 478 00109 68 04 01 00 00 push 260 ; 00000104H 0010e 8b 00 mov eax, DWORD PTR [eax] 00110 89 85 40 fd ff ff mov DWORD PTR _File$54859[ebp], eax 00116 8d 85 44 fd ff ff lea eax, DWORD PTR _File$54859[ebp+4] 0011c 50 push eax 0011d 8b 45 e8 mov eax, DWORD PTR -24+[ebp] 00120 ff 30 push DWORD PTR [eax] 00122 56 push esi 00123 ff 15 00 00 00 00 call DWORD PTR _GetModuleFileNameEx 00129 85 c0 test eax, eax 0012b 74 5c je SHORT $L54877 ; Line 481 |
![]() |
![]() |
![]() |
#36 | |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
New version v0.4:
http://nsis.sourceforge.net/File:LockedList.zip Quote:
Stu |
|
![]() |
![]() |
![]() |
#37 |
Junior Member
Join Date: Jan 2006
Posts: 22
|
Thank you Stu!
|
![]() |
![]() |
![]() |
#38 |
Junior Member
Join Date: Feb 2008
Location: Austin, TX
Posts: 11
|
I have a question about the LockedList plugin. Does AddFile support searching an entire directory? I couldn't find where it specifically said it was supported in the readme. I wanted to know that this is an option, before I go and try to fix my installer problems using this plugin.
Hopefully it does, because this plugin looks awesome and is basically the perfect solution for what I'm trying to do. |
![]() |
![]() |
![]() |
#39 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You mean if the file is in a folder or possibly in sub folders?
Stu |
![]() |
![]() |
![]() |
#40 |
Junior Member
Join Date: Feb 2008
Location: Austin, TX
Posts: 11
|
Yes, I want it to search my entire application directory to make sure nothing is being used before I go and try to update files. I didn't see anywhere that said wildcards were supported, but if then are, then that is fantastic. Thank you!
|
![]() |
![]() |
![]() |
|
Tags |
handle, plug-in |
Thread Tools | Search this Thread |
Display Modes | |
|
|