LockedList plug-in

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ukreator
    Junior Member
    • Aug 2010
    • 1

    IsFileLocked issue

    Hi Stu

    Thanks for the plugin, it is very good and helpful.

    Anyway, while testing it in my installer I've found one bug. It treat file as blocked in the case when this file has non-existent directories within the full path. This can be easily fixed by replacing this piece of code at line 2050 in LockedList.cpp

    code:

    if (GetLastError() != ERROR_FILE_NOT_FOUND)
    fLocked = TRUE;

    with

    code:

    if ((err != ERROR_FILE_NOT_FOUND) && (err != ERROR_PATH_NOT_FOUND))
    fLocked = TRUE;

    Also it would be great to replace

    code:

    #include "afxres.h"

    to

    code:

    #include <windows.h>

    in LockedList.rc to be able to compile with MSVC Express edition.

    Dmitry

    Comment

    • Afrow UK
      Moderator
      • Nov 2002
      • 8434

      Thanks I'll put in those mods

      Stu

      Comment

      • Afrow UK
        Moderator
        • Nov 2002
        • 8434

        v2.0 uploaded.

        Stu

        Comment

        • TheGrudge
          Junior Member
          • Jul 2010
          • 9

          LockedList plugin doesn't seem to work with x64?
          I added this line in the installer script:

          LockedList::AddModule "$INSTDIR\some.dll"

          When compiled with w32, the dll is detected and the running program is shown. But when compiled on x64 and running it on the x64-Version of the program that is locking the dll, the file is not shown in the locked list.

          Is this a known issue?

          Comment

          • Animaether
            Major Dude
            • Jun 2001
            • 1173

            Originally Posted by TheGrudge View Post
            LockedList plugin doesn't seem to work with x64? [...] Is this a known issue?
            Yes. Because NSIS itself is not 64bit, and thus the LockedList plugin isn't 64bit, it also can't really access 64bit process information that would be required for this.

            One thing you can try is testing if the file is locked, rather than the module. For this you might have to use a manual testing method, like trying to open the file for appending. If that fails - the file is locked. There's a few downsides to that method (you touch the file, and you won't know -what- is locking the file), but it's possibly all you've got

            Comment

            • mj_blue
              Junior Member
              • Sep 2007
              • 13

              Add Custom not working?

              Hi, I am making an enhancement to our installer to change the horrible "MCI-Command Handling Window" holding open an activex control to be a more sensible message but I can't get the AddCustom work.

              I have tried using the example LockedListCustom.nsi and this builds but when I say 'Yes' to the question is myapp running it never show sin the lockedlist window. I get the same behaviour in my own installer.

              Details:

              lockedlist V2.0
              OS: XP SP3
              NSIS: 2.46


              code:

              Function Isocxlocked
              LockedList::IsFileLocked $INSTDIR\axagp.ocx
              Pop $R1
              ${If} $R1 == true
              MessageBox MB_OK|MB_ICONINFORMATION `$INSTDIR\axagp.ocx IS locked!!??`
              ${Else}
              MessageBox MB_OK|MB_ICONINFORMATION `$INSTDIR\axagp.ocx is not locked.`
              ${EndIf}
              Push true

              FunctionEnd

              Function MyAppCallback
              Pop $R0

              ; Message box instead of actual logical test...
              ${If} ${Cmd} `MessageBox MB_YESNO|MB_ICONQUESTION 'Is $R0 running?' IDYES`
              Push true
              ${Else}
              Push false
              ${EndIf}

              FunctionEnd

              Function LockedListShow
              !insertmacro MUI_HEADER_TEXT `List of open Browsers with myapp in Use` ``
              GetFunctionAddress $R1 Isocxlocked
              LockedList::AddCustom /icon $INSTDIR\antixgpb.exe 'Internet Explorer' iexplore.exe $R1
              GetFunctionAddress $R0 MyAppCallback
              LockedList::AddCustom /icon $PLUGINSDIR\myapp.ico `My App v1.0` myapp.exe $R0
              LockedList:ialog /searching "Searching for Browsers in use" /noprograms "No Browsers have Game Player in use" /autoclose
              FunctionEnd

              I have this running twice in the code above, once detecting if the file is in use (and currently forcing a true return) and once is extracted straight from the demo app.

              Any help with how to get this working appreciated.

              Thanks

              Mark Jones
              Last edited by mj_blue; 6 October 2010, 13:57. Reason: no smiley

              Comment

              • Animaether
                Major Dude
                • Jun 2001
                • 1173

                uh oh... looks like a bug - an older version of LockedList (which we use, haven't done the round of plugin updates yet) does work correctly with the example.

                Comment

                • mj_blue
                  Junior Member
                  • Sep 2007
                  • 13

                  Hi Animaether,

                  what version of the plugin are you using? I'll downgrade on my test setup and check that this code does actually work in principle.

                  Thanks

                  Mark

                  Comment

                  • Animaether
                    Major Dude
                    • Jun 2001
                    • 1173

                    My version is not versioned, so I can't say... but the date on the file inside the archive is 2010/Apr/28 - which would make it version 1.5 . Actually, I should have 1.6 in the actual current build as that fixes the Next button text. There's quite a few changes since 1.5/1.6, so I'd wait and see if Afrow knows what the problem might be (I didn't spot anything standing out in the source code, but I'm not a C/C++ programmer) so it can be fixed

                    Comment

                    • mj_blue
                      Junior Member
                      • Sep 2007
                      • 13

                      Yes, it looks like this bug was introduced in V1.7, this works in V1.6 but when I upgrade to V1.7 then myapp never gets shown using the custom example.

                      A lot changed between the versions so I can't even see anything obvious to try and help sorry

                      I could only see that it changed from using uiFunctionAddress to iFunctionAddress

                      Mark

                      Comment

                      • MrSpock77
                        Junior Member
                        • Apr 2010
                        • 5

                        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.

                        Comment

                        • Afrow UK
                          Moderator
                          • Nov 2002
                          • 8434

                          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

                          Comment

                          • MSG
                            Major Dude
                            • Oct 2006
                            • 1892

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

                            Comment

                            • mj_blue
                              Junior Member
                              • Sep 2007
                              • 13

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

                              Comment

                              • Afrow UK
                                Moderator
                                • Nov 2002
                                • 8434

                                That would be helpful. You can use Visual Studio Express:
                                Visual Studio dev tools & services make app development easy for any developer, on any platform & language. Develop with our code editor or IDE anywhere for free.

                                Will also need a Windows SDK suitable for Windows 2000.

                                Stu

                                Comment

                                Working...
                                X