[Q] how to make my apps autorun whenever my phone starts - Windows Phone 7 Q&A, Help & Troubleshooting

hi,guys
i try to achieve it by using fiinix's dllimport dll,but now i have no idea?whocan give me some advices?
thank you!

This is a mildly scary idea, but an interesting potential hack.
On desktop Windows, you'd either use the registry, the Startup folder of the Start menu, or create an NT Service that ran automatically.
The registry key is
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
or
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
but WP7 only has those registry paths up through CurrentVersion. You could try creating the Run key, and adding entries under it, though.
WP7 doesn't have a "Startup" sub-folder of the Start menu the way that Windows for the PC does, but it does have a Startup folder. The path is \Windows\Startup. You'd probably want to create a shortcut, most likely to "app://<APP_GUID_HERE>/_default" because that's how app paths are described in the registry, although I can't promise that would work.
While WP7 does have Services, I don't think they're how you'd want to do this. For one thing, they may need to be written in native code, which would make it very tricky to run them on a stock ROM.
In any case, any of these changes are going to require at least interop-unlock (root-unlock would make it easier) or full-unlock. Using DllImport doesn't actually give you any extra permissions; it just makes it eaier to call native functions. They still run with your limited permissions (such as no ability to edit the Registry or the \Windows folder), though.

GoodDayToDie said:
This is a mildly scary idea, but an interesting potential hack.
On desktop Windows, you'd either use the registry, the Startup folder of the Start menu, or create an NT Service that ran automatically.
The registry key is
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
or
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
but WP7 only has those registry paths up through CurrentVersion. You could try creating the Run key, and adding entries under it, though.
WP7 doesn't have a "Startup" sub-folder of the Start menu the way that Windows for the PC does, but it does have a Startup folder. The path is \Windows\Startup. You'd probably want to create a shortcut, most likely to "app://<APP_GUID_HERE>/_default" because that's how app paths are described in the registry, although I can't promise that would work.
While WP7 does have Services, I don't think they're how you'd want to do this. For one thing, they may need to be written in native code, which would make it very tricky to run them on a stock ROM.
In any case, any of these changes are going to require at least interop-unlock (root-unlock would make it easier) or full-unlock. Using DllImport doesn't actually give you any extra permissions; it just makes it eaier to call native functions. They still run with your limited permissions (such as no ability to edit the Registry or the \Windows folder), though.
Click to expand...
Click to collapse
good idea!but it is a little difficult to achieve now.and do you know fiinix's screen_capture app use backroundworker to achieve the backround task.however,when i use such method on my htc T9292,nothing happened.do i need any other skill to achieve such goal?

Related

LNK files useless?

hi,
please advise if i am wrong with my thoughts.
i think it is useless and a waste of performance to use LNK files (at least the ms ones).
lets have a look at the calendar.lnk:
if you want to launch the calendar app, you are launching first the calendar.lnk. the lnk file points to a registry setting (mscalendar). so the launcher (or systemhandler or whatever) needs to lookup there to findout what the programm-name and the required parameters are (in this case "poutlook.exe calendar". now after a while of doing nothing effectively the system finally begins to execute poutlook.exe calendar...
so whats the point of using lnk files?
i see so many launchers, programms even tweak utilities which make use of lnk files.
e.g. if you change one of your softkeys with a tweak utility to "phone", it does the same useless thing: it points to a link file instead directly to cprog.exe.
hopefully i am totally wrong but then please give me some advise.
thx
lnk is shortcut files
same as in windows
in windows if you want to start your program from the desktop
and dont want to copy the tons of files the exe file needs to start
to the desktop too you have a shortcut to the exe file
Some more on the subject:
The use of lnk files does not slow down the loading, in fact it can make it much more officiant.
Take Skype for example: it has a large executable (several MB). If you were to place that exe under "programs" to launch it it will take the system several seconds (quite noticeable period of time) just to find the icon inside the exe so even if you were just scrolling through your programs the device would appear to hang while the icon was loading.
A solution to that (which now became official part of the program installation) was to keep the icon in smaller exe (a resource dll or just plain ico file can also be used) and the lnk will "state" that the icon is not in the main exe.
Another use of the lnk files is the one you mentioned your self:
poutlook.exe calendar
Without lnk files you would be forced to type any parameters manually every time just like in the good old dos days.
By the way, the process you described, lnk-registry-exe does not take that long on current devices.
Just try launching a given exe directly and check if you notice any difference in lag.
If anything, it is the certificate check combined with relatively slow read speeds of flash memory that make WM 5 and 6 devices look sluggish.
levenum,
thanks a lot for your time and explanation.
sure, i was aware that lnk files help you to launch more easily programs with longer command strings when you use the default launcher.
but how about a different launcher (e.g. rltoday), where you setup once your config within that launcher. would you really point to the calendar.lnk file (which points to registry, which points to an exe file) instead of typing "poutlook.exe -calendar" directly into the launching path within rltoday?
anyway, if you say that there is no time lag, the discussion is more or less of "academical nature".
thanks
oliver
I am not familiar with rltoday, but it all comes down to how the programmer implemented the launcher.
There are two different commands, CreateProcess designed specifically to launch executable files and for that purpose only.
SellExecuteEx that acts exactly like a click in file explorer. The writer of the launcher has the option of which to use and I suspect they often use the second command.
The reason is simple: they want to give the user as much options as possible. If you want to bother and look up the exe and its command line, good for you, go for it. But what if you are a regular user who just wants to get that stupid icon on his today screen?
He wouldn't know or care about lnk->registry->exe. He just knows to look under windows\start menu\programs for something familiar.
Also having to interpret input of different types may be extra work so some launcher creators may want to only allow lnk and let the system understand and run their content.
That way they do not need to implement options for different icons, command line parameters and control panel applets.

..........................

............................................
.....................................
excellent work as always, thanks a lot!
Nice. Make as many options as there can be.
email settings
very nice, just installed so far so good. installed my cabs no problem, instruction to do this are pretty clear.
i have been reading about UC from slueth on how it install my setting for my email, not having much luck understanding, got it to install my cabs no problem. next i am trying to learn how to copy my email settings, i dont know if this can be done with this program? and if you can help me do this, its only 1 email account pop3 so not much info.
thanks
Lupe
Sounds cool, in fact, I liked it the first time, When it was UC. Just kidding I had to say it, just had to. I look forward to giving this a go when I have a moment.
JimmyMcGee said:
Sounds cool, in fact, I liked it the first time, When it was UC. Just kidding I had to say it, just had to. I look forward to giving this a go when I have a moment.
Click to expand...
Click to collapse
Thanks...I think
Let me take this opportunity however to say a couple of things about UC, and specifically how this tool is really for a different purpose.
First off, although UC is a nice standard, even Sleuth acknowledges that there is really nothing new in what he is doing with UC. He took some standard autorun.exe techniques and registry entries and bundled them to make a procedure that used to take 3 or 4 steps now take 2. UC adds nothing new, other than a standardized way to use autorun.
Also, UC mainly is meant for fully automated installs of a storage card. So, you pop your card in the slot, and sdautorun processes the sdconfig.txt automatically. UC can install CABs, provision XML and copy files (with limited success). However you must first set up your sdconfig.txt file and build your XML files manually or by exporting registry keys. You must set all this up beforehand in the sdconfig file.
SASHIMI takes a different approach in that you don't need to set up a config.txt file and it isn't bound to statically install the same things each time. In addition, since it can import reg keys natively (well, technically it calls another included app to do it, but it's all bundled in the installer) you don't need to go through the hassle of exporting reg keys, and then converting them to .XML (and optionally rolling them into a .CAB file).
Other advantages SASHIMI has:
In addition to running fully automated, you can choose to run only Manual, or Manual+Auto which will allow you each time to be prompted with a set of CABs and .REG files which you wish to install.
Customizing .CAB installs by tethering/binding .REG and .MSCR files so you can easily map additional configuration entries to a particular .CAB
Logging, so you can track what has been done
Transfer entire directory structure. If you have several folders with multiple subfolders you want transfered from storage you can do this easily.
Modular - the multiple directory structure allows for nice compartamentalization and organization of applications and configuration settings. Things aren't stored in static config.txt files or difficult XML. Simple .REG files, CABS, and optionally MortScript files if you want to use them.
All of these benefits come with only one drawback, which is inherent in this technique. That is it may not be fully automated. Of course this makes sense because if you want to be prompted about which CABs you want to set up or where you want to install them, you need to invest a little time answering prompts. I think the time to do this is considerably less than creating a config.txt file.
In addition, SASHIMI can be run using only Auto mode, in which case it is fully automated (and logged). In fact, it can even be configured to be run automatically when the SD card is put in if you so choose (I will be writing up instructions for that).
So, it really depends what you want to do. I honestly feel that SASHIMI can do everything autorun (and thus UC) can do and more. The exception is it can't import XML. I may update this by including autorun in the package and build this feature in as well. Personally, I think it's easier to work with .REG than .XML. UC however, has a slightly simpler structure which of course why it isn't as feature rich. I think it lends itself more to it's main purpose...which is to be cooked into ROMs and do a fully automated install at boot.
However, as the name implies, SASHIMI is a RAW installer and is meant more for users who want full control of what is getting installed (generally users who use lighter, uncooked ROMs and want to install more apps, etc.
Although, as I said everyone can use it. I think you really need to download it and run through the tutorial to see the power it has.
thx!
Awesome!!!!!! Been following your dev work on this and I should say this is a really great new level you've taken this package!!!!
Gonanaaa try this!
Thanks for this
Sashimi works great. You did a marvelous job of documenting it. Follow the directions and you have an easy solution for us flashing junkies....Bravo!
parleyp said:
Sashimi works great. You did a marvelous job of documenting it. Follow the directions and you have an easy solution for us flashing junkies....Bravo!
Click to expand...
Click to collapse
Thanks for your support.
Please feel free to make suggestions/bug reports/feature enhancements.
I couldn't think of anything else it needed at the time, but I'm sure it's not perfect.
On my list so far is:
Add support to use XML provisioning files (in addition to REG). - Not sure if I will put this in both Manual AND Auto modes...thinking maybe just Auto.
Writeup instructions, and maybe a little update that shows/updates the program to run in UC/Autorun mode. - This will allow it to run in auto mode as soon as the SD card is placed in the device (or a new device is started for the first time with the SD in the slot).
Integrate a config.txt / sdconfig.txt file so those of you who run UC can easily move/switch between both apps. Basically the idea is SASHIMI will process the config.txt file in addition to what it already does. It is kind of repetitive, since then you would be able to either import an XML through my methods, or just put your XML/CPY/EXEC commands in the config.txt file. Obviously if you ONLY use config/sdconfig.txt then there really isn't a need to use SASHIMI too, but if you want the extra options while still maintaining any work you did with UC then it's a go!
I would like to try to keep the app aroung it's central purpose, which is as an installer automater/helper app...so try to keep suggestions/recommendations around that.
thanks
better than uc, imho
thanks for you help bengalih, from your other thread, got my emails set up,
i used tiermanns Personal OEMizer to create my provisioning XML.
i then used the task manager you provided and bam, it worked.
this is why i believe SASHIMI is the best choice. i flash many roms, not all roms have the same programs installed, when i use uc i have to change my config.txt or i might install something that is already in the rom or i might miss something that is not in the rom. yea yea i know, cry me a river
heres what i like, i put my stuff in auto file, like my spb mobile, spb weather and a few others that no one installs because they must be purchased, then all my others in the "manual file" stuff like pcm keyboard, rss hub, htc end key, etc and google search which makes you stop and accept user agreement, if i have something in the manual file thats already installed in the rom you just flashed, just click no when it gets to it and on to the next cab.
i believe with sleuths uc if a cab requires a reboot it cant be used, for example i can put spb phone suite in manual and once completed it ask if i want to reboot, i select no and now it goes to the next cab, once im done with the cabs i want to install then i reboot very very nice
thanks
Lupe
overhaulengines said:
thanks for you help bengalih, from your other thread, got my emails set up,
i used tiermanns Personal OEMizer to create my provisioning XML.
i then used the task manager you provided and bam, it worked.
this is why i believe SASHIMI is the best choice. ...
Click to expand...
Click to collapse
Thanks Lupe...glad you got it worked out.
I am finishing up the next version, which will incorporate UC as well, so if users have an sdconfig.txt file they want to use it can also be used by SASHIMI (in reality I am calling UC's SDAutorun.exe to do it). So, it will be like a combined installer.
There still isn't a substitute for UC in terms of cooking it into a ROM to run automatically on first boot, but with my next version you will be able to use the sdconfig.txt and you will also be able to initiaze SASHIMI when the storage card is inserted. This makes it ideal if you need to provision alot of phones and each one is slightly different.
It sounds like you are taking advantage of the manual+auto install...great. FYI if a .CAB is already unstalled, then the following will happen:
1) If in Manual mode, it will ask you to remove the old CAB first and then it will ask you the location to install the new one. Of course you can always skip the CAB in manual mode if you don't want to reinstall.
2) If in Auto mode it will automatically remove the CAB and install it again.
Ah, one last thing...the Task Manager is DotFred's task manager, I can't take the credit for that application, and I will be sure to credit him in the next release notes.
Version 3.0 coming soon.
I'm finishing up version 3.0 to be release by end of week.
Here are the following updates:
v.3.0
- XML integration added! Use XMLs with/instead of .REG files to provision your device.
- UC integration and the ability to use sdconfig.txt files.
- Option to auto-launch when Storage Card is inserted.
- Better Log handling and INTEGRATED log viewer.
- Additional menus for less clutter and more choices!
- More status dialogs to let you know what's happening when.
- Ability to create/restore Program Menu shortcuts to any location.
- \Scripts and \Root directories available in both Auto and Manual modes for more control!
- Moved tandem/bundled .REG processing before .CAB installation for the ability to import registry entries prior to application install. .MSCR and .XML tandem files process after .CAB installation.
- Optimized code formatting
Let me know if there are additional options you would like to see.
Does the SDConfig.txt file use eliminate the ability to use the programs default folder based way of separating and installing? The program is excellent as is. But if I were shooting for the moon I would suggest adding ability to export personal information to .XML or .REG from current device for use after flash...
aadadams said:
Does the SDConfig.txt file use eliminate the ability to use the programs default folder based way of separating and installing? The program is excellent as is. But if I were shooting for the moon I would suggest adding ability to export personal information to .XML or .REG from current device for use after flash...
Click to expand...
Click to collapse
I completely agree with this. If you were able to have the tool create the .xml and/or .reg files from your currently installed ROM, it would make an excellent tool a killer app.
Thanks for the work!
aadadams said:
Does the SDConfig.txt file use eliminate the ability to use the programs default folder based way of separating and installing? The program is excellent as is. But if I were shooting for the moon I would suggest adding ability to export personal information to .XML or .REG from current device for use after flash...
Click to expand...
Click to collapse
No, the SDConfig.txt file is an ADDITIONAL step in the Auto phase.
So, after running either the Auto, or Manual+Auto modes the last step will be to process an SDConfig.txt file if it exists AND the option to use UC is enabled within SASHIMI.
I think that answers your question.
I did also add the option to do a backup of the entire registry to a file. But, your suggestion gives me an idea....
I can't really provide an interface with MortScript to do a selective backup of the registry, but what I may be able to do is read another configuration file. So, the user would create a file with the following format:
HKCU\Settings\Phone Settings\
HKLM\Control Panel\Sounds\
HKLM\Software\Application1\
Click to expand...
Click to collapse
Whatever keys are listed in the entries will be written out to a .REG file in the Manual\Reg directory and can then be imported if desired or moved to Auto\Reg.
Would that suffice for what you are asking?
That, my friend, would be EXCELLENT! This is an awesome application! Keep up the good work!
Thanks for everything, sir. I cannot wait to try this out.
Ok, I have implemented all the above features.
I just need to do a bit more testing and then repackage the .CAB and update the documentation.
Unless i get anymore feature requests/bug reports I will be upping this probably by Friday.
If any new feature requests are too complex (but worth doing) they may wait until next version.

WM6.5 Start Menu Customising In Kitchen

I'm using the Diamond kitchen HERE. I am really struggling to organise my start menu.
I've been able to create folders using the initflashes.dat and mxipinit_startmenu_001.provxml.
But Windows installs default icons that I have been unable to remove. Where do I remove the icons such as Calendat, Tasks, Messaging etc...? I want to remove them from the start menu root, into my new created folders.
Any help would be very much appreciated!
You need to take a multi-pronged attack to control the 6.5 start menu, lol. There are many different ways to do it.
First, the icons. One approach is to search on the sys folder for "icon." Can't remember the names (icon_games.png, or something like that). There is one big-ass folder with all the icons. Just delete the ones you don't like or need. Or, create your own icon, rename it the way it's named in sys, and stick it in a package that runs later. Then you'll never have to think about it again, as long as you keep the package.
As far as folders go, I've dug out all the provxml's that create start menu shortcuts and I've deleted all of the program shortcuts (I left the settings stuff alone). I don't remember what all the provxmls are named, but you can usually tell just looking at the title. I recommend either organizing the dump file in your kitchen by extension, and then copying all the .provxmls out and examining them (some are hidden). So, if you make changes to any of them, then you should again stick them in the package with your icons that runs at the end of the cooking process. Personally, I install my entire start menu by cab file during customization, and that's where my directory is created. I've editted out everything in the initiflashfiles.dat and app.dat files. I'm not recommending that you take this approach, but this is what I do, lol.
The last thing you need to do is to cook in your HKLM\Security\Shell\Startinfo reg setting. This has all of the folder icon settings (if you use the .png icons-personally, I don't). It also orders everything the way you like it. I've also found that I never have problems with the owner info and buttons settings not showing up with this cooked in. When you look at that reg directory, you'll probably see a lot of crap in there that isn't in your start menu (or in the wrong place). Just delete those entries.
Getting that menu set up is a pain, but once you have it done, it's not so bad.
Edit: you can also run a mortscript during customization to clean and re-organize the SM. I've done that, but there's just something unappealing about moving stuff around and deleting stuff. You usually end up with a messy startinfo registry (mine's clean as a whistle now, lol). But it does work. You can also write scripts to delete the 'icon' values in the registry to use icon.lnk files to set your folder icons. It pretty much comes down to what's convenient and what you're familiar with.

[Q] Cannot access registry anymore after accentcolor change

Hey there,
I got a Samsung Omnia 7 with Telekom Branding and a serious problem. I cannot access the registry of my phone anymore with any tool. WP7 Root tools and the registry editor from TouchXperience keeps crashing.
What I been doing is trying to add a new accent color.
I first went to [HKEY_LOCAL_MACHINE\ControlPanel\Themes] and then in the folder which contains the theme names. I have created there a correct Dword entry and called the name "grau".
Well, then I switched into [HKEY_LOCAL_MACHINE\ControlPanel\Themes\0\Accents] and wanted to add there another accent color with the index number 11. I was looking for the hex values on my PC while my phone screen got locked.
After unlocking it again, I couldnt access any of the tools anymore.
Also when I go into the control panel -> design (where you can choose light/dark background and accent color) it just kicks me out of the menu.
I dont know what I should do, I need something which lets me access the registry somehow or an app which could remove the key...
Any help is greatly appreciated
You can do write-only registry operations in a few ways, but one of the easiest is to use provxml. Download the Interop Unlock XAP from the Dev&Hacking sub-forum and open it in 7-zip (the built-in Windows ZIP explorer won't work for this). There's a .. folder. Navigate it up to ..\..\..\..\.. or so, then there's a provxml folder. Open it, and there's a file inside. Edit that file. It'll have some registry write commands in an xml format (wap-provisioning, you can read about it on MSDN if you want). Put the registry commands you want into the file and save it back into the XAP archive. Then, follow the normal steps for interop-unlock on a Samsung phone, except don't install the original app (deploy your modified version). This will process the provxml and make the registry changes.
Note: provxml can be used to delete registry values as well as create or modify them. This is a great way to undo partial jobs like adding a new theme that isn't supposed to be there.
Thanks a lot for your reply.
It worked out. I removed all those broken keys.
I had done loads of registry changes and a bunch of tweaks for the phone, at the end I did a hard reset.
I'll wait for tools the next time

[Q] Messed up registry

Hello,
I experimented with the WP7 Root Tools and tried to add an own theme by creating a folder called "2" inside the Themes folder in the registry. After I did that I could not open any app anymore. I can't open the Root Tools app or any other marketplace-app. I tried to fix the problem with the MFG menu of my LG e900 but I can't start that either.
Do you have any way to fix my problem? I don't want to reset my phone and loose all my text messages and my dictionary!
If you don't have a recent backup (which you seriously should; why would you go poke the registry without knowing one???) then yeah, hard-reset it pretty much the only option. You could try opening the Theme control panel in Settings and see if it clears things up for you, or you could try writing an app that uses the LG provxml driver to delete the offending registry key *BEFORE THE APP LOADS ITS UI* so that it *might* get run before crashing, but those are my only guesses as to waht might save you.
If you're going to semi-blindly poke the registry, *ALWAYS* have a backup at hand.
GoodDayToDie said:
you could try writing an app that uses the LG provxml driver to delete the offending registry key *BEFORE THE APP LOADS ITS UI* so that it *might* get run before crashing
Click to expand...
Click to collapse
Do you think this is possible? So I might give it a try.
Do you know where I have to read to learn this?
Do you have any WP7 dev experience? The basic concept is pretty straightforward, but it helps if I don't have to explain the basics of app development. I've attached a ZIP archive that contains the source code for a very basic app that uses LG provxml.
Your app will need the following things:
NewSysInfoComDLL.dll (native library that talks to the LG provxml driver).
WPInteropManifest.xml (file that allows your app to talk to native code).
ID_CAP_INTEROPSERVICES in WMAppManifest.xml (to access drivers).
Reference to the InteropServices .NET framework DLL (for the ComBridge API).
In the constructor for the main page, or possibly even in the app initialization code that goes in App.xaml.cs - whichever place gets executed first - you'll need to do the following:
Initialize the COM bridge to the native library (the *Interop*.cs files will help here).
Call the LG provision XML API with a provxml string that deletes the registry ney you created (you can find the provxml reference for Windows Compact 7 on MSDN).
If you're very lucky, this will fix your registry before the app tries to read the registry, goes looking for the additional theme data, doesn't find it, and crashes.
reason adocde
Thank you so far!
I am a very basic programmer, so I don't know very much about it, but I have created a few apps already.
The example looks really interesting, but I think it only shows how to read a registry key. How can I write one instead?
ProvXML reference (I did tell you how to find this yourself...) http://msdn.microsoft.com/en-us/library/gg155017.aspx
You want the registry provider, obviously, and you want to delete a key, so that will be a nocharacteristic element.
Physatty said:
Hello,
I experimented with the WP7 Root Tools and tried to add an own theme by creating a folder called "2" inside the Themes folder in the registry. After I did that I could not open any app anymore. I can't open the Root Tools app or any other marketplace-app. I tried to fix the problem with the MFG menu of my LG e900 but I can't start that either.
Do you have any way to fix my problem? I don't want to reset my phone and loose all my text messages and my dictionary!
Click to expand...
Click to collapse
i had the same issue, but i tried it a few months ago manually, to manage the second folder. but i messed the same thing up, its not the fault of wp7 root tools, its just to the registry. my out was an hard reset. which resets the registry too.
Dinchy87 said:
i had the same issue, but i tried it a few months ago manually, to manage the second folder. but i messed the same thing up, its not the fault of wp7 root tools, its just to the registry. my out was an hard reset. which resets the registry too.
Click to expand...
Click to collapse
And that's what I did now.

Categories

Resources