Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   LockedList plug-in (http://forums.winamp.com/showthread.php?t=274168)

MrSpock77 11th October 2010 08:50

SilentSearch doesn't work as expected in Windows 2000 (SP4). I tried to run LockedListTest.nsi. The callback function is called for every running process, which is not correct. I did also notice that the Path is empty.

HTML Code:

Testing LockedList without threading, please wait...
Id: 8
Path:
Description: Process Id: 8
Id: 160
Path:
Description: Process Id: 160
Id: 188
Path:
Description: Process Id: 188
Id: 208
Path:
Description: NetDDE Agent
Id: 236
Path:
Description: Process Id: 236
Id: 248
Path:
Description: Process Id: 248
Id: 436
Path:
Description: Process Id: 436
Id: 464
Path:
Description: Process Id: 464
Id: 500
Path:
Description: Process Id: 500
Id: 532
Path:
Description: Process Id: 532
Id: 580
Path:
Description: Process Id: 580
Id: 624
Path:
Description: SYSTEM AGENT COM WINDOW
Id: 692
Path:
Description: Process Id: 692
Id: 712
Path:
Description: Process Id: 712
Id: 732
Path:
Description: Process Id: 732
Id: 744
Path:
Description: Process Id: 744
Id: 768
Path:
Description: Process Id: 768
Id: 1232
Path:
Description: Process Id: 1232
Id: 1296
Path:
Description: ModemDeviceChange
Id: 1380
Path:
Description: Process Id: 1380
Id: 1072
Path:
Description: Process Id: 1072
Id: 1156
Path:
Description: Process Id: 1156
Id: 1392
Path:
Description: Windows Task Manager
Id: 704
Path:
Description: LockedListTest Setup
Searching... 100%
Completed

A few of our customers still use Windows 2000, so I would appreciate if this can be fixed.

Afrow UK 11th October 2010 11:04

I'm quite busy at the moment with University. When I get some free time I'll take a look at both issues. I don't have a Windows 2000 machine handy though; only Windows XP.

Stu

MSG 11th October 2010 19:48

I can test on win2k if you want. You can also poke me in the IRC channel (nick Message).

mj_blue 12th October 2010 08:26

Thanks Afrow.. I am looking into getting setup so I can build plugins and will try stepping through it if I ever get setup

Afrow UK 12th October 2010 08:35

That would be helpful. You can use Visual Studio Express:
http://www.microsoft.com/express/Windows/
Will also need a Windows SDK suitable for Windows 2000.

Stu

Afrow UK 19th October 2010 13:28

Uploaded v2.2:
* Fixed AddCustom not adding items.
* No longer returns processes with no file path.
* Added /autonext to automatically go to the next page when no items are found.

Note: The Windows 2000 issue is not fixed (merely avoided). It is likely that this plug-in will not work on Windows 2000 (it may use API only available in XP and above).

Stu

mj_blue 19th October 2010 17:54

Custom callbacks now work a treat for me in V2.2, Thanks Afrow. I did look at if I could build this but the solution appeared to be a VS2010 solution and I am setup with VS2008 for work.

Thanks again

Mark

MrSpock77 22nd December 2010 15:07

I would like to have another switch to LockedList::Dialog and LockedList::InitDialog which automatically closes the dialog if no running applications were found. I just want to move on to the next page, without having to click Next.

Afrow UK 24th December 2010 14:21

Just noticed /autonext is missing from the readme (except under the changelog). Will fix the readme. /autonext is what you want.

Stu

Anders 24th December 2010 15:06

Quote:

Originally Posted by Afrow UK (Post 2709075)
Note: The Windows 2000 issue is not fixed (merely avoided). It is likely that this plug-in will not work on Windows 2000 (it may use API only available in XP and above).

I don't see any reason why you can't make this work on 2000 (And probably NT4), but you have some hardcoded constants that are wrong (I just looked at a small part of the source, there are probably more :) )

PHP Code:

  // Skip System Idle Process and System.
  
if (file.ProcessId == || file.ProcessId == 4)
    return 
TRUE

System process pid is 8 on 2k and 2 on NT4 IIRC

When getting SystemHandleInformation on <=2003 (no more service packs there) you can check the object type directly without the need for threads (Must skip pipe's IIRC)

LoRd_MuldeR 24th December 2010 15:42

Quote:

Originally Posted by Afrow UK (Post 2729848)
Just noticed /autonext is missing from the readme (except under the changelog). Will fix the readme. /autonext is what you want.

Stu

That's something I've been looking for too.

Small request: Would it be possible to proceed automatically, as soon as all conflicting programs have been closed?

Currently it only proceeds automatically if initially no conflicting program was running...

Afrow UK 24th December 2010 16:50

Quote:

Originally Posted by LoRd_MuldeR (Post 2729865)
Small request: Would it be possible to proceed automatically, as soon as all conflicting programs have been closed?

This is in for next version. Thanks Anders I will look into that. I used threads because sometimes the func calls never return. Do you mean this should not happen on <= 2003? MuldeR, is there some remoting software you can install on the 2000 VM so that I can access it? I'm not sure if LogMeIn is an option. The other option I guess is I buy and mount a drive to install 2000 on and then create a VirtualBox image from it.

Stu

LoRd_MuldeR 24th December 2010 18:11

Quote:

Originally Posted by Afrow UK (Post 2729880)
This is in for next version. Thanks Anders I will look into that. I used threads because sometimes the func calls never return. Do you mean this should not happen on <= 2003? MuldeR, is there some remoting software you can install on the 2000 VM so that I can access it? I'm not sure if LogMeIn is an option. The other option I guess is I buy and mount a drive to install 2000 on and then create a VirtualBox image from it.

Stu

Is TeamViewer okay for you? (see your PM)

Anders 24th December 2010 23:54

Quote:

Originally Posted by Afrow UK (Post 2729880)
Do you mean this should not happen on <= 2003?
Stu

No, I mean the object type constants are known, and only certain object types cause problems when getting their name, so you can filter away based on the type before getting the names of the types you are interested in...

LoRd_MuldeR 26th December 2010 13:48

Quote:

Originally Posted by LoRd_MuldeR (Post 2729896)
Is TeamViewer okay for you? (see your PM)

Afrow UK, still interested in Win2k remote access? Got my PM?

I am ready...

MrSpock77 26th December 2010 21:19

Quote:

Originally Posted by Afrow UK (Post 2729848)
Just noticed /autonext is missing from the readme (except under the changelog). Will fix the readme. /autonext is what you want.

Stu

Thank you!

mrphantuan 29th December 2010 07:36

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







________________
Chúng tôi là một trong những công ty tu van du hoc hàng đầu Việt Nam .Chúng tôi là đại diện cho nhiều tập đoàn du hoc hàng đầu TG tại Vietnam .Hàng năm đều có các xuất hoc bong du hoc miễn phí đi vụ du hoc singapore.

LoRd_MuldeR 4th January 2011 21:13

Quote:

Originally Posted by Afrow UK (Post 2729880)
This is in for next version. Thanks Anders I will look into that. I used threads because sometimes the func calls never return. Do you mean this should not happen on <= 2003? MuldeR, is there some remoting software you can install on the 2000 VM so that I can access it? I'm not sure if LogMeIn is an option. The other option I guess is I buy and mount a drive to install 2000 on and then create a VirtualBox image from it.

Stu

Sorry for bumping this thread, but are there any news on this? :confused:

(The offer still stands: If I can help by providing access to the Win2k machine, feel free to contact me at any time!)

Afrow UK 7th February 2011 11:53

Hi just an update on this. Sorry LoRd_MuldeR I never got to take up your offer on the Windows 2000 VM you had set up. Fortunately I was able to get a copy and use it in VirtualBox. The issue you found is now fixed. I just need to fix up the other small issues that Anders pointed out. Should have a new version out later today.

Stu

LoRd_MuldeR 7th February 2011 13:10

Quote:

Originally Posted by Afrow UK (Post 2744432)
Hi just an update on this. Sorry LoRd_MuldeR I never got to take up your offer on the Windows 2000 VM you had set up. Fortunately I was able to get a copy and use it in VirtualBox. The issue you found is now fixed. I just need to fix up the other small issues that Anders pointed out. Should have a new version out later today.

Stu

That's good news :)

Afrow UK 7th February 2011 17:54

v2.3 uploaded.

Stu

LoRd_MuldeR 10th February 2011 23:07

Quote:

Originally Posted by Afrow UK (Post 2744550)
v2.3 uploaded.

Stu

Thanks. Works for me under Win2k now :)

angelblaze 28th February 2011 11:23

Auto Terminate Patch
 
Below is a tiny patch to add auto close/kill without user having to click next/install.

Add new parameter /autoterm to LockedList::Dialog

Only tested for the following invocation
LockedList::Dialog /autoterm /autonext /autoclosesilent "" ""

probably not best way to do it but it seems to work :-)

code:

Index: LockedList.cpp
===================================================================
--- LockedList.cpp (revision 2134)
+++ LockedList.cpp (working copy)
@@ -1598,6 +1598,11 @@
{
g_fAutoNext = TRUE;
}
+ // Automatically start to Auto close/kill
+ else if (lstrcmpi(pszParam, TEXT("/autoterm")) == 0)
+ {
+ g_fAutoClosing = TRUE;
+ }
// Add new ignore button.
else if (lstrcmpi(pszParam, TEXT("/ignorebtn")) == 0)
{


Afrow UK 28th February 2011 12:35

That's a bit drastic but OK :p

I will add and test when I get some time.

Stu

angelblaze 28th February 2011 13:04

Agreed that closing programs without user interaction isn't a generally good idea. Our reasons are:
a) the updater needs to be totally passive with no user interaction required
b) our user base has proven itself incapable of closing programs on their own
c) other nsis plugins that I tried didn't provide nice feedback so we heard some complains about the updater being unresponsive if it took a long time to close a program.

Thank you for the excellent plugin! :cool:

Afrow UK 2nd July 2011 14:21

Small bug fix release v2.4.
Quote:

* Improved support for Windows x64 - now retrieves 64-bit processes but still cannot enumerate 64-bit modules (this is not possible from a 32-bit process).
* Fixed infinite loop which sometimes occurred on Cancel button click.
http://nsis.sourceforge.net/File:LockedList.zip

Stu

LoRd_MuldeR 7th July 2011 16:16

Hello.

I experience crash with v2.4 on Windows XP (32-Bit), but not on Windows 7 (x64):
http://img850.imageshack.us/img850/9316/clipboard49.png

The code used is:
http://pastie.org/2178330

BTW: I am using the Unicode version of your plugin-in, if that matters.

(Reverted back to v2.3 and problem is gone)

Afrow UK 11th July 2011 16:44

Quote:

v2.5 - 11th July 2011
* Fixed crash on Windows XP 32-bit and below.
Stu

LoRd_MuldeR 11th July 2011 16:51

Quote:

Originally Posted by Afrow UK (Post 2786924)
Quote:

v2.5 - 11th July 2011
* Fixed crash on Windows XP 32-bit and below.
Stu

http://forum.doom9.org/images/smilies/thanks-t.gif

Amarynth 1st August 2011 11:58

Hi :)

I wanted to use this plugin to check if someone else in LAN is locking files. But it seems as if the plugin is not able to check this.

Am I doing something wrong or isn't it possible to check if a file in the network is locked my someone else?


Ama

LoRd_MuldeR 1st August 2011 12:29

Quote:

Originally Posted by Amarynth (Post 2791675)
Hi :)

I wanted to use this plugin to check if someone else in LAN is locking files. But it seems as if the plugin is not able to check this.

Am I doing something wrong or isn't it possible to check if a file in the network is locked my someone else?


Ama

i don't think this will work.

LockedList is process-based, i.e. it checks for "local" processes that hold a lock on critical files and thus prevent the installer form continuing. While it might be possible to detect whether a local file is locked by "remote" access (actually the file would then be locked by the "file sharing" service running on the local machine), it won't be possible to tell which process on the "remote" computer holds the lock. There normally is, for good reason, no way to enumerate/analyze the processes on a "remote" machine. You'd have to run some kind of "monitoring service" on the remote machine to make information about running processes available over the network. Needles to say that the communication with the monitoring service should be encrypted and password protected. WMI can probably do that though...

Without additional "monitoring" software running on the "remote" machine, the machine_id + user_id holding the lock on the file is probably all you can get. That's basically what "Shared Folders" -> "Session" shows in the "Computer Manager".

LSI_Riedel 20th September 2011 09:51

Hello,

http://pastebin.com/g8dtbrMz

We're using LockedList to search for a running Process (see above part) in the .onInit function.
On 2.4 and 2.5 the installer simply exit (crashs?) between WelcomeScreen and License Page. On 2.3 it works. The problem occurs only on WinXP 64.

We have just downgrade to 2.3 and hope we got no other problems.
Is there a way to fix it? Did you need some more information?


Thanks
Mike

Afrow UK 20th September 2011 18:07

To fix it one would need to rebuild the plug-in and hook it up to the debugger in Visual Studio on XP 64. Or perhaps you can compare the source code of the different versions to identify what the problem could be.

Stu

Afrow UK 9th January 2012 12:16

New version:
Quote:

v2.6 - 9th January 2012
* Added missing calls to EnableDebugPriv() in FindProcess and EnumProcesses.
Stu

rumovoice 29th February 2012 13:14

When LockedList is used with basic UI it correctly shows locked file list but when I click next it disables all buttons and clears user interface. So I end up with empty window and can't even close it. How to fix it? I don't want to switch to modern UI because I like minimalistic style and I'm writing an updater with only single page (setup progress).

Here's repro code:
code:
RequestExecutionLevel user
SetCompress off
XPStyle on
OutFile "test.exe"
InstallDir "$EXEDIR\inst"
Icon "${NSISDIR}\contrib\graphics\icons\orange-install.ico"

Section "Main Section" SecMain
SetOutPath "$INSTDIR"
LockedList::AddFolder $INSTDIR
LockedList::Dialog
Pop $R0
;MessageBox MB_ICONINFORMATION|MB_OK "$R0"
File "foo.dll"
SectionEnd


Afrow UK 29th February 2012 17:49

You're not using the plug-in correctly. Whether you use MUI or not you can't show a dialog from a Section.

Stu

rumovoice 29th February 2012 17:56

Can you please show me simple example how to use it correctly? (I'm new to NSIS and I only found examples for MUI)

Afrow UK 1st March 2012 10:31

It is the same for MUI as it is for non MUI. You create a custom page using Page.

Stu

SwiftHalf 2nd March 2012 09:04

64 bit issue
 
I just wanted to report a bug on 64 bit machines.

The plug-in calls Wow64DisableWow64FsRedirection but doesn't switch filesystem redirection on afterwards. I found this problem because I was trying to install some dlls to System32, and they ended up in the wrong place!

I worked around the problem by adding the following to my nsi script after the lockedlist plugin had done its stuff:

StrCpy $1 0
System::Call kernel32::Wow64RevertWow64FsRedirection(i.r0) i.r1

stopasking 16th March 2012 07:27

Hi,

the '/autonext' option is not working with the UNICODE plugin (on my Win7 x64 machine - if it is relevant).

When I use 'LockedList::Show' and do a Pop $0 there are different strings in the ANSI and UNICODE plugin when I press the back button. $0 == 'back' (ANSI) and $0 == 'b' (UNICODE). This makes it hard to write compatible NSIS code (or I am using it the wrong way ;) ).


All times are GMT. The time now is 17:39.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.