Hi everyone,
after some twiddling I got the 3.8 branch to compile on my machine and
recompiled burn.exe to test the "Run instead RunOnce" approach.
Seems to work like a charm...
There were only a few changes I needed to make in file registration.cpp:
Changed consts to refer to correct registry keys:
===================================
const LPCWSTR REGISTRY_RUN_KEY =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
const LPCWSTR REGISTRY_RUN_ONCE_KEY =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce";
Added function to check whether we run on XP:
==================================
static BOOL UseRunInsteadRunOnce() {
OSVERSIONINFO versionInfo;
versionInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
if ( GetVersionEx( &versionInfo ) ) {
if ( versionInfo.dwMajorVersion < 6 ) {
return TRUE;
}
}
return FALSE;
}
Changed Writing / Deleting correct keys in function UpdateResumeMode:
=====================================================
// write run key
if ( UseRunInsteadRunOnce() ) {
hr = RegCreate(pRegistration->hkRoot, REGISTRY_RUN_KEY, KEY_WRITE,
&hkRun);
} else {
hr = RegCreate(pRegistration->hkRoot, REGISTRY_RUN_ONCE_KEY,
KEY_WRITE, &hkRun);
}
// delete run key value
if ( UseRunInsteadRunOnce() ) {
hr = RegOpen(pRegistration->hkRoot, REGISTRY_RUN_KEY, KEY_WRITE,
&hkRun);
} else {
hr = RegOpen(pRegistration->hkRoot, REGISTRY_RUN_ONCE_KEY, KEY_WRITE,
&hkRun);
}
Would you guys consider this the correct way to implement this?
Best regards,
Tobias
_____
Von: Rob Mensching [mailto:r...@robmensching.com]
Gesendet: Freitag, 8. November 2013 16:13
An: WiX toolset developer mailing list
Betreff: Re: [WiX-devs] Issue & possible solution: Burn Startup-Screen is shown
twice (on Windows XP) if bootstrapper contains driver-installation
What if on XP Burn writes to the Run key instead? That's actually what we did
in for all OSes in the early days of Burn. We had to move to the RunOnce key to
ensure on restart the Bundle launched elevated and the user would not be
prompted for elevation post-restart. Fortunately, on XP we don't have to worry
about elevation.
This could also be the most straight forward fix if it works. I'm hoping the
"runonce.exe" just runs the runonce key. <smile/>
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
WiX-devs mailing list
WiX-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-devs