On Aug 29, 2009, at 7:08 AM, Adrian Buehlmann wrote:

> [Switching to this thread (I first picked the wrong email
> to respond to)]
>
> On 24.08.2009 23:56, Benjamin Pollack wrote:
>> # HG changeset patch
>> # User Benjamin Pollack <benja...@fogcreek.com>
>> # Date 1251150789 14400
>> # Branch stable
>> # Node ID 43fa88c8dae519cd3193c974e631c65b48074c95
>> # Parent  4555e191a783f462b7a14ff9873f5e4c07c3d00e
>> installer: automatically terminate taskbar process
>
> On 29.08.2009 10:42, Adrian Buehlmann wrote:
>> On 29.08.2009 05:21, Steve Borho wrote:
>>> On Fri, Aug 28, 2009 at 4:57 PM, Adrian
>>> Buehlmann<adr...@cadifra.com> wrote:
>>>> Apologies, I picked the wrong email to respond to.
>>>>
>>>> What I wanted to try out installing was:
>>>>
>>>> [thg-dev] [PATCH] installer: automatically terminate taskbar
>>>> process
>>>
>>> That change is in the latest nightly.   I tested it on a few
>>> computers
>>> and it seems to do the right thing.  If the installing user is the
>>> only one logged in, it quietly closes the taskbar app and finishes
>>> the
>>> install.  If another user was logged in, it shows a warning about
>>> not
>>> being able to shutdown tortoisehg, and allows them to cancel or
>>> retry.
>>>
>>> The warning message could probably be improved, but the
>>> functionality
>>> seems correct.
>>
>> Ok. Latest nightly as of writing this seems to be
>> TortoiseHg-Nightly-090827.exe
>> (looking at http://bitbucket.org/tortoisehg/thg-winbuild/downloads/
>> right now).
>>
>> The test case I had in mind is about the following scenario:
>>
>> A user is logged-in as normal user 'x' (not a member of the
>> administrators group), having the thgtaskbar.exe running.
>>
>> Then that user x decides to install a new version of TortoiseHg.
>>
>> He starts the installer by holding down the shift key on the
>> keyboard and clicking the right mouse button while pointing
>> at the installer exe, then chooses "Run as..." from the context
>> menu that is presented ("Run as..." appears only when
>> shift-right-clicking).
>>
>> In the dialog appearing, he chooses the administrator account
>> to run the exe, and enters the password for that login.
>>
>> This is in fact how I mostly install software myself, since
>> I don't want to be logged in as an admin on a Windows XP
>> system while surfing The Evil Net. But I don't want to log
>> out just to install a software component.
>>
>> The question I had is: The patch seems to be going fishing
>> for the thgtaskbar's window and closes it.
>>
>> Does that work in this use case?
>>
>> Maybe I'll try testing that during the day...
>
> Tested on Windows XP SP 3. Very nice.
>
> Works fine, as long as the options dialog is not open, in
> which case thgtaskbar.exe crashes while installing.
> (Which IMHO is acceptable. thgtaskbar.exe is not exactly an
> application for editing mission critical data. It's only
> settings changes that are lost worst case)
>
> BTW, I was wrong with the shift key: "Run as" is there without
> shift. I must have confused that with another case...
>
> Ah, found it: shift key is need to get the "Run as.." menu
> entry when starting "Add or Remove Programs" in the Control
> Panel.


Sorry; I missed this email the first time around.

As you noted, running as Administrator for the install (which, as far
as I know, is the only way you can run the Tortoise installer anyway
right now) works just fine.  The rule in Windows is that higher-
priority processes can always find lower-priority process windows and
send them messages.  If and when Tortoise allows installing without
administrator privileges, I'll tweak the code to iterate through all
such windows, not just the first one, and to make sure that the user
running the process is correct.  (Another option would be to make the
taskbar's global mutex be based on the user name.  I can explore both
options when we get there.)

If crashing on installation is not okay with you, Steve, I'll track
down the crash and fix it.  Since I made the shutdown happen as late
as possible, I think it ought to be okay.

--Benjamin

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to