Old 12th July 2012, 15:15   #241
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
New version.
Quote:
2.6.1.3 - 12th July 2012
* Fixed Back button triggering auto-next during scan when /autonext is used.
http://nsis.sourceforge.net/File:LockedList.zip

Stu
Afrow UK is offline   Reply With Quote
Old 12th July 2012, 17:07   #242
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 499
Send a message via ICQ to Pawel
Stu,
The newest plugin crashes for me
LockedList Unicode: 2.6.1.3
NSIS Unicode 2.46.5
Windows 7 x64 (Language PL)
Used syntax:
PHP Code:
Function CreateLockedListPage

    
${If} ${AtLeastWinNt4}
        !
insertmacro MUI_HEADER_TEXT "Title" "Subtitle"
        
LockedList::AddModule "$INSTDIR\winamp.exe"
        
LockedList::Dialog /heading "Text1" /colheadings "Text2" "Text3" /noprograms "Text4" /searching "Text5" /endsearch "Text6" /endmonitor "Text7" /autoclosesilent "Text8" $(^NextBtn) /menuitems "Text9" "Text10"
    
${EndIf}
    
FunctionEnd 
It crashes on the end of searching, when going to next page (Components Page).

Edit:
Last working build is: 2.6.1.0
[Build 2.6.1.1, 2.6.1.2 and 2.6.1.3 crashes]

Edit2:
ANSI build 2.6.1.3 works OK.
However, if I use /autonext option and do:
- Welcome Page -> LockedPage (not showed thanks to /autonext) -> Components Page <-- LockedPage -> I can not go to previous page, as LockedPage is autonext forward...
I hope you understand.

-Pawel
Pawel is offline   Reply With Quote
Old 12th July 2012, 17:26   #243
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
What OS?

Edit: Regarding the autonext problem see a few posts back.

Stu
Afrow UK is offline   Reply With Quote
Old 12th July 2012, 17:27   #244
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 499
Send a message via ICQ to Pawel
As I wrote in my first post, Windows 7 x64 with Polish language.
Pawel is offline   Reply With Quote
Old 12th July 2012, 17:44   #245
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 499
Send a message via ICQ to Pawel
OK, thanks.
-Pawel
Pawel is offline   Reply With Quote
Old 12th July 2012, 18:37   #246
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
New version.
Quote:
2.6.1.4 - 12th July 2012
* Fixed a crash in SystemEnum (v1.6) for the Unicode build.
http://nsis.sourceforge.net/File:LockedList.zip

Stu
Afrow UK is offline   Reply With Quote
Old 12th July 2012, 18:45   #247
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 499
Send a message via ICQ to Pawel
Stu, I confirm it is fixed now. Thx.
-Pawel
Pawel is offline   Reply With Quote
Old 12th July 2012, 20:04   #248
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
Great

Edit: Post 8000 FTW!

Stu
Afrow UK is offline   Reply With Quote
Old 10th December 2012, 21:53   #249
SubJunk
Junior Member
 
Join Date: Dec 2012
Posts: 3
This is a great plugin, thanks!
Is there a way to use autonext and autoclosesilent? In other words I would like it to skip the page if the file is not locked, but if it is locked then offer an option to close it.
SubJunk is offline   Reply With Quote
Old 11th December 2012, 15:14   #250
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
Does it not work with both switches?

Stu
Afrow UK is offline   Reply With Quote
Old 11th December 2012, 21:27   #251
SubJunk
Junior Member
 
Join Date: Dec 2012
Posts: 3
It does, sorry I was using the wrong syntax when I tested. Thanks again for the plugin
SubJunk is offline   Reply With Quote
Old 30th January 2013, 03:50   #252
PoRtAbLe_StEaLtH
Junior Member
 
Join Date: Jul 2011
Posts: 49
Quote:
Originally Posted by LoRd_MuldeR View Post
Hi.

Is sometimes get the problem that the LockedList plug-in will get stuck in the "Cancelling search, please wait..." state.



It will go on, as soon as I press some key or move the mouse cursor...

My code looks like this:
http://pastie.org/private/bfkzo1mn4adypn2t83xtq

Thanks in advance for any advice


are you the developer of LameXP?
PoRtAbLe_StEaLtH is offline   Reply With Quote
Old 30th January 2013, 20:53   #253
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Quote:
Originally Posted by PoRtAbLe_StEaLtH View Post
are you the developer of LameXP?
Yes

(You could have followed the link to my web-site in my profile)

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 2nd February 2013, 04:41   #254
PoRtAbLe_StEaLtH
Junior Member
 
Join Date: Jul 2011
Posts: 49
Quote:
Originally Posted by LoRd_MuldeR View Post
Yes

(You could have followed the link to my web-site in my profile)
duh.. sorry bro..
i hardly click on profiles, links, etc ..
i come here for info, help, etc ..

i use your app all the time.. great stuff man.

@ AfrowUK
hey i have a question.. before finding your plugin.. i was using batch commands w/ handle.exe.

ie.
PHP Code:
@echo off
for /"tokens=3,6 delims=: " %%a in ('handle ${FILE} ^| find "pid:"') do (
set PID=%%a
set Handle
=%%b

call 
:Stage2
)
goto 
end

:stage2
for /"tokens=1 delims=:" %%a in ("%Handle%") do set Handle=%%a

REM 
echo %Handle% - %PID%
echo 
handle -%Handle% -%PID%
DEL ${FILE}
:
end 

and it worked at killing the processes required to delete the file.
but it required the additional handle.exe, which installs additional registry keys, etc.

i noticed your plugin is much faster/easier to use.. ..
however.. it kills the process to everyfile in the directory.

whereas.. if i used the batch command w/ handle.exe,
only the file's process is killed.

would you know why?

Here's my coding:
PHP Code:
IfFileExists "${FILE}0 NotExist_
  LockedList
::AddFile "${FILE}"
  
GetFunctionAddress $R0 SilentSearchCallback
  LockedList
::SilentSearch $R0
  Delete 
"${FILE}"
  
NotExist_
PHP Code:
Function SilentSearchCallback
  Pop $R0
  Pop $R1
  Pop $R2
    
${If} $R0 != ""
      
Push autoclose
    
${Else}
      
Push false
    
${EndIf}
FunctionEnd 
PoRtAbLe_StEaLtH is offline   Reply With Quote
Old 2nd February 2013, 10:38   #255
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
It will only kill processes with a handle open on the file. If you can prove otherwise then I will need a sample script. What type of file is it by the way?

Stu
Afrow UK is offline   Reply With Quote
Old 15th November 2013, 17:00   #256
Rkuncewicz
Junior Member
 
Join Date: Nov 2013
Posts: 3
Hey Afrow, I recently began to use your LockedList plugin and it works beautifully! It's perfect for exactly what we need, however the only issue I am running into is that the percentage sometimes gets out of whack. At times it works fine going from 0-100%, however other times it goes up to ~55000%. It's very odd behaviour, and was just wondering if there's anything we could be doing wrong?

I'm running Windows 7 SP1, if you need anything just ask! Thanks
Rkuncewicz is offline   Reply With Quote
Old 21st November 2013, 06:59   #257
voidcast
Junior Member
 
Join Date: Nov 2013
Posts: 2
Hi,

We are using LockedList in our setups and also been getting the huge %% issue. I investigated and fixed it. Going to clean the code up a bit and suggest my fix to the community very soon.
voidcast is offline   Reply With Quote
Old 21st November 2013, 14:14   #258
Rkuncewicz
Junior Member
 
Join Date: Nov 2013
Posts: 3
Thanks! We were going to look into the issue at some point, but at the moment we are swamped with doing other things Glad someone looked into it!
Rkuncewicz is offline   Reply With Quote
Old 26th November 2013, 17:35   #259
voidcast
Junior Member
 
Join Date: Nov 2013
Posts: 2
First of all, sorry if my memory is letting me down. I've been investigating this quite a while ago and may be wrong in details. However we made a custom LockedList build with this fix applied, put it to use in production and never seen the huge percent issue since then.

AFAIR the issue may only appear when working with LockedList::AddFile. LockedList code has a function called GetSystemHandleInformation that retrieves a structure containing all open system handles.

GetSystemHandleInformation is typically called twice: first time from GetSystemHandlesCount to get the total number of open handles and set maximum value of the progress bar, second time to iterate through handles and find processes locking the file.

Now imagine you use LockedList::AddFile and LockedList::AddModule together in your setup. For AddModule LockedList uses a totally different approach and enumerates process modules only. To set maximum value of the progress bar it calls GetSystemHandlesCount to retrieve total number of handles (say, 50000) and GetSystemModulesCount to retrieve number of modules (say, 500) and sets progress bar top to 50500. Then it starts the actual search and iterates through handles and modules.

The problem is GetSystemHandlesCount has a mistake and may fail in either of these calls. Fail in the first call will cause progress bar maximum to be 500 instead of 50500 so during the search it will go over the top and show huge percent values. Fail in the second call will break the search and file lockers will not be found.

Now about the mistake. GetSystemHandleInformation calls WinAPI function called NtQuerySystemInformation. Again it does this twice: first time to know the size of the structure to contain system handles, second time to fill the structure. The problem is number of open handles may increase between these calls so that memory allocated for SYSTEM_HANDLE_INFORMATION structure will not be enough to hold it. This is likely to happen during intense activity of other processes. In that case NtQuerySystemInformation will return STATUS_INFO_LENGTH_MISMATCH and invoker must take care of this by increasing the buffer and trying again, but LockedList does not. See http://forum.sysinternals.com/howto-...opic18892.html for reference:

Quote:
An unusual aspect of calling NtQuerySystemInformation with SystemHandleInformation is that if you supply a buffer which is too small, it returns STATUS_INFO_LENGTH_MISMATCH (0xc0000004) instead of giving you the correct buffer size in ReturnLength. This means you will have to guess the buffer size. A common technique is to call NtQuerySystemInformation in a loop until it succeeds with STATUS_SUCCESS (0), reallocating and doubling the buffer size each time it fails with STATUS_INFO_LENGTH_MISMATCH.
This is what I added to GetSystemHandleInformation:

code:
while(size < max_size)
{
// Allocate required memory.
pSysHandleInformation = (SYSTEM_HANDLE_INFORMATION*)GlobalAlloc(GPTR, size);
if (pSysHandleInformation == NULL)
return NULL;

// Query the objects (system wide).
NTSTATUS res = NtQuerySystemInformation(SystemHandleInformation, pSysHandleInformation, size, NULL);
if (NT_SUCCESS(res))
break;
else
{
GlobalFree(pSysHandleInformation);
pSysHandleInformation = NULL;

if (res != STATUS_INFO_LENGTH_MISMATCH)
{
break;
}

size *= 2;
}
}



ntstatus.h has to be included for checking return codes. See full diff for 2.6.1.4 attached.

I suggest this to be included into project mainline.
Attached Files
File Type: txt SystemEnum.txt (2.5 KB, 206 views)
voidcast is offline   Reply With Quote
Old 1st December 2013, 16:52   #260
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
New plug-in version:
Quote:
3.0.0.0 - 1st December 2013
* Fixed GetSystemHandleInformation() failing due to change in the number of handles between NtQuerySystemInformation() calls [special thanks to voidcast].
* 64-bit module support via LockedList64.dll [special thanks to Ilya Kotelnikov].
As of v3.0.0.0, 64-bit module enumeration (for ::AddModule) is now supported. Simply extract a copy of LockedList64.dll to $PLUGINSDIR on 64-bit machines (see the LockedListKernel32.nsi example script).

Thanks for your input guys!

Stu
Afrow UK is offline   Reply With Quote
Old 1st December 2013, 17:34   #261
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 499
Send a message via ICQ to Pawel
Thanks Stu.
Works very nice (I am using only 32 bit version)
-Pawel
Pawel is offline   Reply With Quote
Old 5th December 2013, 14:31   #262
Rkuncewicz
Junior Member
 
Join Date: Nov 2013
Posts: 3
That was quite fast, thanks so much! Thanks to voidcast too, your solution worked perfectly
Rkuncewicz is offline   Reply With Quote
Old 7th December 2013, 20:49   #263
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
New version:
Quote:
3.0.0.1 - 7th December 2013
* Added 64-bit modules counting via LockedList64 for the progress bar and silent search.
http://nsis.sourceforge.net/LockedList_plug-in

Stu
Afrow UK is offline   Reply With Quote
Old 31st January 2014, 17:15   #264
shadowpoa
Member
 
Join Date: Jun 2011
Posts: 52
corrupted stack

Hi Afrow,

I´m using the LockeList with silentsearch, and have noticed that at the end of function the stack is corrupted with some lockedlist internal values.

Here´s some of the example on file lockedlisttest.nsi, see the attached image to better understand what i´m saying, many thanks!

In my script I have some 'Pop´s' after the search and then I've noticed that is not the value that i'd have pushed, so I´ve used ${stack:: Debug} "0" to see the values in the stack

PHP Code:
Section `SilentSearch asynchronous testSection_SilentSearchThreadTest

  DetailPrint 
`Testing LockedList with threading, please wait...`

  
LockedList::AddFile `${THE_FILE}`
  
LockedList::AddModule $PLUGINSDIR\LockedList.dll

  
# Begin the search in a separate thread.
  
GetFunctionAddress $R0 SilentSearchCallback
  LockedList
::SilentSearch $R0 /async

  
# Loop while the search takes place. We could do other stuff here.
  
${Do}
    
LockedList::SilentWait /time 500
    Pop $R0
  
${LoopWhile$R0 == `/wait`
${
stack::Debug"0"
  
DetailPrint `Searching... 100%`

SectionEnd 
Attached Files
File Type: zip silentsearch.zip (146.9 KB, 134 views)
shadowpoa is offline   Reply With Quote
Old 22nd April 2014, 12:34   #265
kampel
Junior Member
 
Join Date: Apr 2014
Posts: 1
Hi,

the documentation of plugin and the examples has some errors:
1) The order of parameters is wrong, you have to write:
LockedList::SilentSearch /async $R0
2) The return value of fct SilentWait isn't "/wait", but only "wait"
Then the async mode works fine:-)

Thanks Stu for valuable plugin!

Kampel
kampel is offline   Reply With Quote
Old 28th July 2014, 08:20   #266
Satara
Junior Member
 
Join Date: Nov 2013
Posts: 9
Problem with superfetch on windows

Hi,
we are using this plugin for quite a while and it does a great job. However we recently had a customer which complained that the installer was showing a program that wasn't really running. Finally it came out that it was blocked by superfetch. A windows caching mechanism to improve loading speed of executables that are used often. Would be very nice if the plugin could catch this case in the future.
Best,
Satara
Satara is offline   Reply With Quote
Old 29th July 2014, 08:32   #267
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
What plug-in calls are you using to detect the running application? How did you come to the conclusion that superfetch is to blame? I'm not sure this is something that can be easily fixed, if at all.

Stu
Afrow UK is offline   Reply With Quote
Old 29th July 2014, 23:42   #268
Satara
Junior Member
 
Join Date: Nov 2013
Posts: 9
I am using
code:
LockedList::AddCustom
to add the executables. After we couldn't find the application in the process tab in the task manager, we noticed that the application appeared in the CPU resource monitor. We were able to perform the installation after restarting in safe mode (regular restart didn't help). But I couldn't test if it also would have worked when only stopping the superfetch service manually. I will do so if that happens again.
Satara is offline   Reply With Quote
Old 30th July 2014, 07:13   #269
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
If you're using AddCustom then you are handling the detection yourself in a callback function... What code are you using in your callback function?

Stu
Afrow UK is offline   Reply With Quote
Old 30th July 2014, 10:38   #270
Satara
Junior Member
 
Join Date: Nov 2013
Posts: 9
I am sorry, I've created this quite a while ago and wasn't aware of the details anymore. In my callback I'm just using
code:
LockedList::IsFileLocked
on the executable.
Satara is offline   Reply With Quote
Old 30th July 2014, 13:49   #271
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
If you are using IsFileLocked on your main application executable then you should use the AddModule function instead. AddCustom+IsFileLocked is really an alternative to AddFile (for open file handles). AddModule is specifically for exe/dll/ocx.

Stu
Afrow UK is offline   Reply With Quote
Old 30th July 2014, 14:50   #272
Satara
Junior Member
 
Join Date: Nov 2013
Posts: 9
Ok thanks for your advise. I will consider that.
Satara is offline   Reply With Quote
Old 1st August 2014, 10:24   #273
Satara
Junior Member
 
Join Date: Nov 2013
Posts: 9
Hi Stu,
after changing to AddModule() I remembered again, why I decided to use AddCustom() back then.
When I use AddModule the title of the application is unpredictable, it just gets a random name and also the icons are sometimes stored separately. Here is the output of the locked list with different versions of CINEMA 4D and 3ds Max:

1 [52212] - Console - CINEMA 4D 64 Bit.exe
2 [55492] - MAXScript Debugger - 3dsmax.exe
3 [54784] - V-Ray messages - 3dsmax.exe
4 [55396] - NVOGLDC invisible - CINEMA 4D 64 Bit.exe
5 [55588] - NVOpenGLFbo - CINEMA 4D 64 Bit.exe
6 [55860] - MAXON Online Updater - CINEMA 4D 64 Bit.exe
7 [55444] - Warning Loading Plug-in DLL - 3dsmax.exe
8 [55040] - MAXScript Debugger - 3dsmax.exe

Is there any possibitly to pass an explicit title or icon to AddModule or is there an alternative which I could use instead of IsFileLocked when using AddCustom?
Satara is offline   Reply With Quote
Old 1st August 2014, 14:08   #274
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
Would it be preferable to use the file description instead (i.e. under Properties -> Details)? I believe this is what Task Manager uses in later versions of Windows.

Stu
Afrow UK is offline   Reply With Quote
Old 1st August 2014, 15:05   #275
Satara
Junior Member
 
Join Date: Nov 2013
Posts: 9
I think the optimal solution would be the title of the main window, because the description is the same for different versions of the application. But the description would be a satisfying solution
Satara is offline   Reply With Quote
Old 5th August 2014, 08:00   #276
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
New version:
Quote:
3.0.0.2 - 5th August 2014
* Added CloseProcess function.
* Improved application window caption lookup to find "main" windows (no owner).
Stu
Afrow UK is offline   Reply With Quote
Old 5th August 2014, 11:48   #277
stass
Senior Member
 
Join Date: Nov 2012
Posts: 144
Why is this ? : http://nsis.sourceforge.net/File:LockedList.zip

Quote:
Warning: This file type may contain malicious code. By executing it, your system may be compromised.
This is a joke?
stass is offline   Reply With Quote
Old 5th August 2014, 13:00   #278
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 853
I don't get that, it's fine for me. Maybe it's your antivirus?

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 5th August 2014, 14:35   #279
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,433
Quote:
Originally Posted by stass View Post
This is a joke?
What is giving you that message? Your antivirus software or Internet Explorer? I have reuploaded with no upx compression - please try downloading again.

Stu
Afrow UK is offline   Reply With Quote
Old 6th August 2014, 06:31   #280
stass
Senior Member
 
Join Date: Nov 2012
Posts: 144
This post is on page http://nsis.sourceforge.net/File:LockedList.zip
Page open the Opera browser. Antivirus is disabled !
Screenshot : http://www.mediafire.com/?waxa911a5pt74tr
stass is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Tags
handle, plug-in

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump