Skip to content
⌘ NSIS Forum Archive

LockedList plug-in

320 posts

Afrow UK#
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
RobertStrong#edited
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
kalverson#
LockedList Plug-in:

The accelerator keys do not work for the next/back buttons. Only the mouse works.
kalverson#
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:😁ialog

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
Afrow UK#
New version v0.4:


v0.4 - 27th September 2007
* Module or file names can now be just the file name as opposed to the full path.
* Folder paths are converted to full paths (some are short DOS paths) before comparison.
* Fixed typo in AddModule function (ModulesCount>FilesCount). Thanks kalverson.
* List view is now scrolled into view while items are added.
* List changed to multiple columns.
* Debug privileges were not being set under SilentSearch.
* Added /ignore switch that prevents the Next button being disabled.
* Added AddApplications to add all running applications to the list.
* Added processing mouse cursor.
* Added right-click context menu with Close and Copy List options.
* Added progress bar.
* Added default program icon for processes without an icon.
* Added code to resize controls for different dialog sizes.
I cannot reproduce that crash kalverson and by the looks of it it's out of my control, unless the module handle being passed is not valid. I could surround it by a try{} block but I am not keen on that idea.

Stu
jrhutch#
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.
jrhutch#
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!
Afrow UK#
Sorry, wild cards are only supported for window classes/captions. If your executable name is unique enough, just use AddModule \File.exe or AddFile \File.txt

The appended \ ensures that it's a file under a folder and not just the end of a file name.

Stu
jrhutch#
Sorry, my question was for adding multiple files, such as AddFile $Drive\SomeDirectory\*.*, or something to that effect.
Animaether#
I'm running into two problems with LockedList...

1. It can't seem to detect that the files I specified are in use.
I'm using:

LockedList::AddModule /NOUNLOAD "$SYSDIR\OurDLL.dll"
( I take it /NOUNLOAD is still required even in the new NSIS handling? )
But as far as the search is concerned, the file is not locked. Unlocker ( http://ccollomb.free.fr/unlocker/ ) says otherwise.
Any tools out there that might help in identifying why LockedList doesn't see it while Unlocker does?
( I'd try whouses.exe as well, but I seem to be whouses.exe-less )


2. LockedList crashes after parsing two of such modules.
The search process reaches 93%, usually when it will display that it found no processes using the file(s), and simply crashes.

Stu - if you need a dump for #2 (oh boy, bad puns), just let me know.
freneticmonkey#
I have had a look at the source code for the lockedlist plugin and it currently only searches the first 127 modules or files loaded for a process. On my machine Internet Explorer with minimal extensions installed has 150+ modules loaded, which means that searching for ActiveX plugins usually fails.
Ocrana#
Is there any problem known that LockedList crashes on XP?
I have some users with reports that the installer will crash after 60% of searching the running processes.
Bad Problem: This are users/customers and I do not have access to their computer to debug. ON all my computers and VM builds nothing crash.
If anyone know possible problems, like AV Scanners or similar things please let me know.

Ocrana
Ocrana#
Hi, just to complete the information:
Installer will crash and computer will reboot automatic.
XP Home on a Intel CPU.

Ocrana
Afrow UK#
The plug-in was developed on Windows XP and I never had a crash. Unless I can reproduce there's not much I can do I'm afraid.

Stu
Ocrana#
Yeah, I understand this. I hoped someone had the same problem and a solution. The Problem in all is that a "user" who cannot install the software will not answer to a mail 🙁

Ocrana
Ocrana#
Hi Afrow,
I have now 3 people with the reboot problem. On Vista and XP. This are the people who gave me a message, I do not want to know how many people have the same problem without inform us.
However I will send today a version with the new lockedlist to one of the Users in hope to get a response this time.

But please also think about a version that do a deep logging to a text file. This will help very much to handle those issues.

Ocrana
Ocrana#
Hi,
I got a feedback from a customer, he wrote: "I tried the new installer. The scan now gets to 70% before it reboots the computer on both XP and Vista 32 bit." before it was around 56%.
What we can do?

Ocrana
Afrow UK#
Sorry I'm quite busy with work at the moment. If I have time at the weekend I will add some switches for logging and maybe upgrade the plugin to use the new plugin API.

Stu
AlexisXu#
Hi,Afrow UK,I download Lockedlist's code,and it can't be complied.VC reports errors:
error C2065: 'WM_NOTIFY_OUTER_NEXT' : undeclared identifier
error C2065: 'NOTIFY_BYE_BYE' : undeclared identifier
error C2065: 'pushstring' : undeclared identifier
error C2065: 'popstring' : undeclared identifier
error C2065: 'WM_NOTIFY_CUSTOM_READY' : undeclared identifier
error C2061: syntax error : identifier 'stack_t'
error C2065: 'EXDLL_INIT' : undeclared identifier
error C2061: syntax error : identifier 'stack_t'

Is there same files missing?
forbjok#
LockedList crashes when no files or modules are added

I just found that when running a setup that contains no LockedList::AddModule or LockedList::AddFile calls, and calls LockedList:: Dialog, it crashes with "An unhandles win32 exception" (the regular Windows segfault message).

My guess is that LockedList:: Dialog fails to check whether some variables normally set by AddFile or AddModule are set.

In most cases this is not a problem of course, as usually there will be files to check for, but in this case the NSI script is generated, and will contain LockedList:: Dialog regardless of whether any files were actually found during generation that causes AddFile or AddModule calls to be made.

I can (and probably will) change the generator to also add the LockedList:: Dialog only when needed, but it would probably be a good idea to also make LockedList:: Dialog perform the necessary checks to prevent it from crashing regardless.
Afrow UK#
v0.9 is now available. Fixed some bugs (including the one last posted; thanks forbjok), added some features, implemented new NSIS plugin API and included a unicode build.

Stu
Animaether#
Heya Afrow,

Good to see this plugin still being worked on after all 🙂

I have no idea if the updates happen to resolve the issue I had earlier - will see eventually in current development, though.

Before upgrading I did run into the crash situation (at 87%, every time) again; it's entirely weird.. changing the compression type, removing a messagebox that displays 2 variables (or changing it so it only displays 1), etc. would make the crash go away; no such crash in the current version as far as I can tell.. but if that sounds indicative of something scary that you'd want to check out anyway, just say the word. The DLL doesn't have version information, buts its date is 2008-02-26.

=====

However, I -am- seeing some garbled output in the dialog list with the new version (edit: non-unicode);

!addplugindir ".\Plugins\"
OutFile "test.exe"

Page Custom customPage

Function customPage
LockedList::AddModule /NOUNLOAD "$WINDIR\notepad.exe"

LockedList:😁ialog
FunctionEnd

Section
SectionEnd
Dialog screenshot:


That garbled line goes away once it's done checking.