View Full Version : [NewRelease] InitLauncher - [HKLM\Init]LaunchXX wrapper
baniaczek
10th April 2007, 06:58 PM
Launching programs using [HKLM\Init]LaunchXX instead of links in \windows\StartUp folder causes some problems. It saves vital resources (slots for running programs, which are limited under WM5 to (AFAIR) 32), but doesn't allow to specify command line parameters and it adds one paramter (number XX), which can be not misunderstood by application. Application should issue SignalStarted(). Things are described here: http://msdn2.microsoft.com/en-us/library/ms901773.aspx. I'm not sure, but in WM6 it is not a problem - there are thousands (or more) of slots.
InitLauncher.exe can solve them.
Simplest configuration:
[HKEY_LOCAL_MACHINE\init]
"Launch96"="InitLauncher.exe"
"App96"="ARGc.exe"
It immediately launches ARGc.exe without parameters.
Something more complicated:
[HKEY_LOCAL_MACHINE\init]
"Launch96"="InitLauncher.exe"
"App96"="ARGc.exe"
"Params96"="\"Launched as 96\" SecondParam"
"Delay96"=dword:4e20
It launches ARGc.exe with two parameters 20 seconds (==20.000ms) after system start.
InitLaunch:
- sleeps Delay** miliseconds,
- executes program specified as App** with optional parameters Params**,
- sleeps DelayEx** miliseconds (not shown above)
- and issues SignalStarted(**).
Last example:
[HKEY_LOCAL_MACHINE\init]
"Launch96"="InitLauncher.exe"
"App96"="ARGc.exe"
"Params96"="\"Launched as 96\""
"Delay96"=dword:4e20
"DelayEx96"=dword:2710
"Launch97"="InitLauncher.exe"
"App97"="ARGc.exe"
"Params97"="\"Launched as 97\""
"Delay97"=dword:4e20
"Launch98"="InitLauncher.exe"
"Depend98"=hex:60,00
"App98"="ARGc.exe"
"Params98"="\"Launched as 98\" SecondParam ThirdOne"
Bootstrap procedure starts two instances of InitLauncher (96 and 97). They are both waiting 20 seconds and they are executing ARGc.exe. Instance 97 exits (issuing SignalStarted(97)), instance 96 sleeps extra 10 seconds and issues SignalStarted(96). Bootstrap procedure (just after SignalStarted(96)) starts instance 98 of InitLauncher, which immediately runs ARGc,exe and exits.
Feel free to use in your ROMs. All parameters except AppXX are optional.
Attached archive:
InitLauncher.exe - main app. Compiled for WM2005
InitLauncher.cpp - source
ARGc.exe - for debugging purposes only
Test_InitLauncher.reg - the las example.
nothin
12th April 2007, 12:10 PM
great thing, if it works :)
to sie moze przydac :)
Proponuje dac info na pdaclub.pl .
Menneisyys
12th April 2007, 07:45 PM
Wowz, great news, will link it from the Safe Mode Bible ( http://www.pocketpcmag.com/blogs/index.php?blog=3&p=1255&more=1&c=1&tb=1&pb=1 ) and also frontpage it in the PPCMag blog!
baniaczek
12th April 2007, 10:05 PM
great thing, if it works :)
to sie moze przydac :)
Proponuje dac info na pdaclub.pl .
Not interesting for non-polish users.
Myślę, że nie ma sensu. Programik jest w zasadzie bezużyteczny dla "szarego" użytkownika. Może co poniektórzy programiści mogliby skorzystać, a sens ma przede wszystkim dla nowych, smażonych romów.
baniaczek
12th April 2007, 10:05 PM
Wowz, great news, will link it from the Safe Mode Bible ( http://www.pocketpcmag.com/blogs/index.php?blog=3&p=1255&more=1&c=1&tb=1&pb=1 ) and also frontpage it in the PPCMag blog!
That's nice :)
baniaczek
2nd May 2007, 03:48 AM
Attached: InitUnLauncher (+source)
command line: InitUnLauncher number1 number2 ... numberN
For every number from command line InitUnLauncher removes values from HKLM\Init: "Delay**", "DelayEx**", "Launch**", "Depend**", "App**", "Params**" if any.
------
With BlueAngel I need to execute specific application (Camera_detect.exe) only once after hard reset (like welcome.exe)
[HKEY_LOCAL_MACHINE\init]
"Launch88"="InitLauncher.exe"
"Depend88"=hex:3c,32,00
"App88"="Camera_Detect.exe"
"Launch89"="InitLauncher.exe"
"Depend89"=hex:58,00
"App89"="InitUnLauncher.exe"
"Params89"="88 89"
First part (*88) starts Camera_Detect.exe. Probably it would be enough to use
"Launch88"="Camera_Detect.exe
"Depend88"=hex:3c,32,00
but using InitLauncher I'm sure, that Camera_Detect will not(!) get anything from command line (garbage, in that case one string argument "88").
Second part (*89), which depends on 0x58 (dec 88) deletes values *88 (camera_detect) and *89 (self)
Feel free to use
oldsap
2nd May 2007, 04:43 AM
will this work on wm5 smartphones?
baniaczek
2nd May 2007, 09:08 PM
will this work on wm5 smartphones?
Probably no. But ... source is included. Sorry. I have no SmartPhone SDK
nothin
7th May 2007, 07:01 PM
Probably no. But ... source is included. Sorry. I have no SmartPhone SDK
Baniaczku, mam pytanie:
jak wczesny moze być launch initlaunchera.
01?
baniaczek
8th May 2007, 02:06 AM
Baniaczku, mam pytanie:
jak wczesny moze być launch initlaunchera.01?
Sprawdzilem przed chwila: co najmniej po shell32.exe (u mnie co najmniej 51). Razem z Depend51=hex:32 00
Zaskoczyles mnie, bo bylem pewny, ze moze byc od 10. Zlinkowalem go najoszczedniej, jak tylko sie dalo, uzywa tylko coredll i tylko operacji na rejestrach, sleep, i ShellExecuteEx.
Po namysle:
No tak. ShellExecuteEx. Jakos mi sie kojarzy z ... shell32.exe
A co? Ma byc wczesniej? Moge poszukac jakiegos API, zeby dalo sie odpalic bez shella. Tylko uwaga - program uruchamiany tez powinien byc niezalezny od shell32
[Edit] ooops.Short in english:
InitLauncher should be executed at least after shell32.exe. In my case: at least as "Launch51"="InitLauncher.exe", "Depend51"=hex:32,00
gbm85
8th May 2007, 02:21 AM
Thanks! This is exactly what I've been looking for to launch tMan after a short delay so it picks up the correct background color!
hercule18
9th May 2007, 10:22 PM
Hi,
I don't know why but initlauncher never worked for whatever was the rom i used.
Does anybody else is experiencing problems to make it work?
bye
Herc.
nothin
9th May 2007, 10:55 PM
Sprawdzilem przed chwila: co najmniej po shell32.exe (u mnie co najmniej 51). Razem z Depend51=hex:32 00
Zaskoczyles mnie, bo bylem pewny, ze moze byc od 10. Zlinkowalem go najoszczedniej, jak tylko sie dalo, uzywa tylko coredll i tylko operacji na rejestrach, sleep, i ShellExecuteEx.
Po namysle:
No tak. ShellExecuteEx. Jakos mi sie kojarzy z ... shell32.exe
A co? Ma byc wczesniej? Moge poszukac jakiegos API, zeby dalo sie odpalic bez shella. Tylko uwaga - program uruchamiany tez powinien byc niezalezny od shell32
[Edit] ooops.Short in english:
InitLauncher should be executed at least after shell32.exe. In my case: at least as "Launch51"="InitLauncher.exe", "Depend51"=hex:32,00
wielkie dzieki za odpowiedz, musze sie pobawic, marzy mi sie hm kiosk mode.. bo o innym shellu moge pomarzyc..
jakby co, jeszcze sie odezwe..
thanks a lot.
AbuYahya
11th January 2009, 09:34 PM
Does this work in 6.1 pro.
does anyone got experiance with it.
OR are the commercial alternatives much better eg mcube & spb
the main reason to use it it would be to prevent a hard reset if a start-up application was crashing/freezing the startup.
would be better if package up in a nice cab file.
thanks
tobbbie
25th January 2012, 03:06 PM
will this work on wm5 smartphones?
Yes it does, but you cannot make any INITxx depend on it before and including home.exe or appman.exe. I tried to delay the loading of home.exe by making it dependent on the InitLauncher - delaying with DelayEx of it, but home.exe never came up.
The author also mentions that for PPC shell.exe has to be loaded - home (and appman?) are the corresponding items on smartphone.
I will have to solve my problem another way. Either finding a simple program which does nothing but wait 10 seconds and then send "SignalStarted" - not needing the shell process or picking a simple homescreen to (re-)boot and get HW devices (BT and WIFI) initialized fully and reliably. Subsequently I can alter the homescreen again to my layout with some fancy stuff that seems to put HW init out of pace by accessing them too early (I guess).
I also tried to not use the APPxx parameter, but then then Initlauncher just terminates immediately - not caring about the DelayEx data :-(
jwoegerbauer
25th January 2012, 04:36 PM
On my CE 6.0 unit I am using a wait-application based on code authored by Chris Tacke
http://blog.opennetcf.com/ctacke/2009/04/15/AutolaunchingCFAppsWithTheHKLMInitRegistryKey.aspx
#include <Windows.h>
BOOL IsAPIReady(DWORD hAPI);
int WINAPI _tWinMain ( HINSTANCE hInstance ,HINSTANCE hPrevInstance ,LPTSTR lpCmdLine ,int nCmdShow )
{
int nLaunchCode = -1;
// Quick check to see whether we were called from within HKLM\init -> by default HKLM\init passes the lauch code
if(lpCmdLine && *lpCmdLine)
{
// MessageBox(NULL, lpCmdLine ,NULL,MB_OK);
nLaunchCode = _ttoi( (const TCHAR *) lpCmdLine);
}
else
{
// MessageBox(NULL, _T("No argumets passed"),NULL,MB_OK);
}
BOOL success = FALSE;
int i = 0;
while((!IsAPIReady(SH_FILESYS_APIS)) && (i++ < 50))
{
Sleep(200);
}
success = (i < 50);
if(success)
{
i = 0;
while((!IsAPIReady(SH_DEVMGR_APIS))&& (i++ < 50))
{
Sleep(200);
}
success = (i < 50);
if(success)
{
i = 0;
while((!IsAPIReady(SH_SHELL))&& (i++ < 50))
{
Sleep(200);
}
success = (i < 50);
if(success)
{
i = 0;
while((!IsAPIReady(SH_WMGR))&& (i++ < 50))
{
Sleep(200);
}
success = (i < 50);
if(success)
{
i = 0;
while((!IsAPIReady(SH_GDI))&& (i++ < 50))
{
Sleep(200);
}
success = (i < 50);
}
}
}
}
if(nLaunchCode != -1)
{
// Since this is application is launched through the registry HKLM\Init we need to call SignalStarted passing in the command line parameter
SignalStarted((DWORD) nLaunchCode);
}
return success;
}
I make this wait-application dependent on device.dll and gwes.dll, and then start as Launch255/Depend255 my application launcher itself, which depends of course on the wait-application. You easily can extend this piece of code by waiting for other APIs ready, as they are defined here (http://msdn.microsoft.com/en-us/library/ee482994.aspx), for example SH_WNET, SH_COMM , SH_TAPI, etc.pp.
tobbbie
25th January 2012, 05:39 PM
On my CE 6.0 unit I am using a wait-application based on code authored by Chris Tacke
http://blog.opennetcf.com/ctacke/2009/04/15/AutolaunchingCFAppsWithTheHKLMInitRegistryKey.aspx
I have found this blog as well in my search for a solution, but there is no compiled version. I also do not depend on any API to be ready as the WLAN HW driver is loaded via NDIS group from COMM\<driver> and I have no way to check if things completed. It is all just a matter of seconds it seems, so a delay of 10 seconds may suffice for me.
I need to check if the oemstartup.dll that displays an animated GIF will delay the boot (I doubt) - but if so then I will pick a picture that has a longer sequence and problem solved.
jwoegerbauer
25th January 2012, 05:55 PM
I have found this blog as well in my search for a solution, but there is no compiled version.
I uploaded my compiled version here (http://www.mediafire.com/download.php?bw66h6mcbrlp4yc).
Forgot to mention the application-launcher I use is AutoLaunch V1.0 by jywilson (http://www.learningce.com/downloads/796.aspx).
tobbbie
25th January 2012, 06:44 PM
I just see an empty folder ""jwoegerbauer" Shared Files / ceFFM" nothing to load from there.
Anyway, I checked on the boot-time vs. oemstartup.dll animation display and found that it actually is fully sequential in the boot-flow. The current animation gives me 4 seconds - and I know how to deal with these :-)
HKCU\Performance\ Home DismisSplash
with animation: 30 seconds
without: 26 seconds
This should give me a path to a solution :-)
jwoegerbauer
25th January 2012, 08:10 PM
I just see an empty folder ""jwoegerbauer" Shared Files / ceFFM" nothing to load from there.
Ooops... Link corrected!
tobbbie
26th January 2012, 09:44 AM
...
HKCU\Performance\ Home DismisSplash
with animation: 30 seconds
without: 26 seconds
This should give me a path to a solution :-)
I could get this further delayed with longer GIF animations, however it did not buy me the right time as the init of HW has not improved. For the simple Homescreen I have reliable and consistent reboot HW Init, when picking a more challenging Homescreen things get inconsistent. If I cannot get this solved with messing around in the INIT sequence and dependencies my way out is rather annoying: replace a reboot with a sequence of apply simple HS, reboot, apply my HS - sigh...
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.