|
|
#81 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
How about this:
code: Usage: code: Stucode: |
|
|
|
|
|
#82 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Yeah, seems like that would work (and be more flexible for general use). How often would the callback be called? Unless it blocks the thread, etc.
|
|
|
|
|
|
#83 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Uploaded v1.1. The callback is called initially before adding the custom item and then again every second after searching has completed.
Edit: And FYI Why do win32 calls GetModuleFileNameEx, EnumProcessModules, EnumProcessModulesEx fail in Wow64? Edit 2: LockedList uses GetProcessImageFileName if it exists so LockedList will work for all executables (32-bit or 64-bit) but cannot work for 64-bit modules. One idea (which Process Explorer uses) is to run a secondary 64-bit process which relays information back to the 32-bit process (in this case, the plug-in) but this would be a lot of work. Stu |
|
|
|
|
|
#84 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Just tried, but the "LockedListCustom.nsi" example goes straight through without invoking the callback function, it seems. I'm using the regular DLL, MD5: 0dd1e0aee3b2aba0483c5d50c4656ba6
Re Edit: yeah, I found similar information a bit after I asked the initial question.. almost makes sense if not for it being something MSFT -could- have addressed if they really wanted to; alas ![]() Re Edit 2: Right - I wouldn't delve into that right away
|
|
|
|
|
|
#85 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Thanks, fixed. Reminder for future I must always test release DLL's as well as debug DLL's
![]() Stu |
|
|
|
|
|
#86 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Excellent - That is actually a pretty elegant solution to an entirely non-elegant problem.. makes LockedList extremely flexible as a sweet side-effect
![]() One question if I may; the Custom example (which is still titled 'Using AddModule and notepad.exe' - btw) seems to use $R0 - the callback function address - 3 times. The docs only specify it once. I commented out the 2nd and 3rd and the example still runs so I suppose they're at least not required - but now I'm curious as to why they're there ![]() *goes to hit the actual installer code to try and hook his simplified locked file check into this* |
|
|
|
|
|
#87 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Sweet - as far as I can tell, this will work beautifully.. still have to test it in the wild, but several quick simple tests haven't revealed any particular problems.
So now I have... ${LockCheck} : a simple locked files checker macro bit that only reports -if- a file is locked (if it exists, and if we care (version number check)), not -what- is locking it.. 1. that I feed target/source files into with a single line call for each module 2. if it is determined none of the files are locked (based on the output of the macro), skip the LockedList dialog, otherwise... 3. initialize the LockedList dialog with those Module (32bit) or Custom (64bit) items that were determined to be locked, which will report the locking applications (32bit) and my Custom items (64bit) 4. which will automagically check everything except for the Custom items for which it calls... 5. a callback which invokes the simple locked files checking macro ${LockCheck} and... 6. tells lockedlist whether or not the file is unlocked based on its output again. It's not perfect, but it's much better than going *BOINK* at a user mid-file installation with a can't-overwrite-this-file dialog
|
|
|
|
|
|
#88 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
I just realized that when the dialog closes, the stack value for the next button is always "next" - which means you can't discern from it whether the user clicked the next (all apps were closed / there was nothing to close to begin with) or the 'ignore' button.
These are one and the same button just with custom captions on them, of course - which also leads to the work-around: grab the text off of the button and compare it to the '/ignore text' flag value you defined. Just thought it might be good if the plugin handled this in the value it pushes to the stack
|
|
|
|
|
|
#89 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Done. Also added an IsFileLocked utility function. See the changelog for full details.
Stu |
|
|
|
|
|
#90 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Sweet - seems you're on a roll
![]() If IsFileLocked works well, I can replace the internal (FileOpen "path" "a") test. At the moment, though, the Pop'ed value seems to be the passed "path" parameter? ( I popped a few more time to different vars, they all seem to be null ) |
|
|
|
|
|
#91 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
That's a bug if it's the first plug-in call (was not initializing global variables such as the stack pointer). If you use it in the callback then it should be fine. Will fix for next version. Someone is reporting a crash but on a window which updates its caption every 100ms (not surprised).
Stu |
|
|
|
|
|
#92 | |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Quote:
yikes #1: why would that crash? yikes #2: why on Earth would an application update its caption 10 times per second?? ( not necessarily in that order ) I've got one that updates its caption every second.. I stick the time in it (taskbar is set to auto-hide, might as well make use of the titlebar screen real estate) ..but 10 times per second? huh. |
|
|
|
|
|
|
#93 |
|
Moderator
|
This is my application. It change title of other appliaction, to show some useful information. It doeasnt have to be 100ms but now it is. In final build it will be probably 500ms (it can't be >1s)
I use Stu's plugin in my installer and it crash when it is trying to kill that application with our title (but only unicode build, ansi build works ok...) And i think , it is because, in some way Process name in application list is displayed as data from title bar I change every x ms... I hope Stu will find way to fix it. -Pawel PLEASE DONATE Projects: My Website | NSIS PL | Winamp PL | Winamp Help (PL) | Ultimate File Manager Winamp translations: Oficjalny Polski Pakiet Językowy (Official Polish Language Pack) Other Winamp projects: Winamp Color Themes | Winamp Icon Packs Winamp Tools: Winamp Tools (All About Winamp | Winamp Backup & Restore | Winamp Translation) |
|
|
|
|
|
#94 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
hmmm.. as far as I can tell, it only grabs the title once.. must be affecting something deeper down
|
|
|
|
|
|
#95 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Turns out it was just a buffer overflow. I am not sure why because dynamically allocating the buffer instead of statically seems to have fixed it. I have also increased the buffer length to 1024 characters and fixed the IsFileLocked bug.
Stu |
|
|
|
|
|
#96 |
|
Moderator
|
Stu,
Yes, it seems it is finally fixed. I will do more tests later. -Pawel PLEASE DONATE Projects: My Website | NSIS PL | Winamp PL | Winamp Help (PL) | Ultimate File Manager Winamp translations: Oficjalny Polski Pakiet Językowy (Official Polish Language Pack) Other Winamp projects: Winamp Color Themes | Winamp Icon Packs Winamp Tools: Winamp Tools (All About Winamp | Winamp Backup & Restore | Winamp Translation) |
|
|
|
|
|
#97 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
confirming the IsFileLocked bugfix. Unfortunately it doesn't recognize the locked DLL as being locked; I guess that might be a distinction similar to why there is an AddFile and an AddModule?
It correctly recognized a text file I opened a file handle to (with another app), so that part works if nothing else
|
|
|
|
|
|
#98 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Yep it will only work on files that have a handle open on them (DLL's do not when they are locked). And yes using AddFile on DLL will not work.
Stu |
|
|
|
|
|
#99 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Gotcha - makes sense (in that weird and twisted Microsoft-state-of-mind kind of sense)
|
|
|
|
|
|
#100 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
one more minor item request...
If the list is empty, could the Next button text revert if /ignore is specified? I just noticed that if I specify the /ignore flag, have a locked file, then unlock that file and the list goes empty stating no further programs need to be closed.. the Next button still reads (the /ignore-supplied string) "Ignore". |
|
|
|
|
|
#101 |
|
Junior Member
|
Is the source for this plug-in available? If not, have you considered open-sourcing it?
|
|
|
|
|
|
#102 |
|
Junior Member
|
|
|
|
|
|
|
#103 |
|
Junior Member
|
Quickly compiled and ran a few of the examples on Vista64...
- After the initial Welcome page, no list was displayed on the second page - Back, Next, and Cancel buttons are active, but nothing happens when clicking them - Have to force the installer to close (system control menu/buttons don't work) Any suggestions? |
|
|
|
|
|
#104 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Which example causes this? I am running Windows 7 x64 and have not had any issues.
Stu |
|
|
|
|
|
#105 |
|
Junior Member
|
|
|
|
|
|
|
#106 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I can only assume something such as anti-virus software is blocking it. Does SilentSearch work?
Stu |
|
|
|
|
|
#107 | |
|
Junior Member
|
Compiling and running LockedListTest.nsi with /S crashes with this info:
Quote:
|
|
|
|
|
|
|
#108 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Make sure the source code is in NSIS\Contrib\LockedList then set the build configuration to Debug (or Debug Unicode if you're using Unicode NSIS). After rebuilding the NSIS installer you can then attach VS to it.
Glad you have VS! Stu |
|
|
|
|
|
#109 |
|
Member
Join Date: Mar 2008
Posts: 73
|
Still have the dependency issue.
It failed to load the Dialog on a fresh XP PC with the following error in the event viewer. Resolve partial assembly failed for Microsft.VC90.CRT.Reference error message. The referenced assembly is not installed on your system. Please let me know |
|
|
|
|
|
#110 | |
|
Junior Member
Join Date: Apr 2010
Posts: 5
|
Quote:
Any help is highly appreciated. |
|
|
|
|
|
|
#111 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Please try v1.4. The DLL had an XML manifest in it defining Microsoft VC90 CRT as a dependency.
Stu |
|
|
|
|
|
#112 |
|
Junior Member
Join Date: Jan 2008
Posts: 21
|
Tested on fresh XP (no any redistributable package installed!) and it works fine
Thanks |
|
|
|
|
|
#113 |
|
Junior Member
Join Date: Apr 2010
Posts: 5
|
|
|
|
|
|
|
#114 |
|
Member
Join Date: Mar 2008
Posts: 73
|
That rocks...Works as expected. Thanks
A requirement is to make the label control transparent and the list contol a little more small.Sicne I'm using UMUI this covers up all the screen . Please advise. |
|
|
|
|
|
#115 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You'll need to use SetCtlColors for the transparency and SetWindowPos API for the list (among others). It may be easier to resize the list in the dialog resource in Visual Studio and rebuild.
Stu |
|
|
|
|
|
#116 |
|
Member
Join Date: Mar 2008
Posts: 73
|
I know the file which will is likely yo be locked by our application , hence is there an option to target that file alone with a if condition to detect whether that file is locked or not.
Check that and show the dialog if necessary. |
|
|
|
|
|
#117 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You can use the SilentSearch function for that but be warned the process can take a little time for modules (even on super fast machines) and even longer for file handles. Hence why the search occurs while the screen is visible.
If you just want to make the label transparent the control ID is defined in resource.h. You need to use InitDialog and Show plugin calls and InitDialog pushes the window handle onto the stack (just like InstallOptions). Stu |
|
|
|
|
|
#118 |
|
Junior Member
Join Date: Apr 2010
Posts: 1
|
/noprograms option for dialog isn't working since v1.2
text always returns to it's default value. just me? Osman |
|
|
|
|
|
#119 | |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
Quote:
The problem is in the source code; it references PARAM_SEARCHING in the part of the code dealing with the /noprograms flag. Must be a copy/paste-effected regression
|
|
|
|
|
|
|
#120 |
|
Member
Join Date: Mar 2008
Posts: 73
|
Was digging the day to display a message when the file is locked.
This is the flow of UI Welcome License Page Directory Install FIles Finish In the main section I have this code: LockedList::IsFileLocked "<Path to FIle"> Pop $R0 I do not want toshow the UI of Locked list , just detect the file Your expertise is needed |
|
|
|
![]() |
|
|||||||
| Tags |
| handle, plug-in |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|