Cold boot auto install - Windows Mobile Development and Hacking General

How would I go about performing an automatic installation of several .CAB files after a cold boot of the XDA 2? These CAB files will be located on a storage card and are part of a commercial package.
Thanks
Tony Hudson

One can create a "autorun.exe" in a folder called "2577" on the memorycard..
But I'm really not sure how...

you can auto install
by putting the updates in the extented rom
http://wiki.xda-developers.com/index.php?pagename=ER2003Edit
not sure how you would go about making them be able to be located on the sd card unless you put in a program in the extented rom
which would again auto install the cab files located on the sd card

I have wrote an eVC app for installing multiple .CAB files on an SD card. I am wanting the CAB files to be installed synchronously then the device to be warm booted so I am calling ShellExecuteEx to open the CAB file, WaitForSingleObject to determine when the CAB file has finished and then KernelIoControl to reboot the device.
The problem is that WaitForSingleObject is returning before the CAB file has closed with an error code of 6 which is invalid handle.
info.cbSize = sizeof(info);
info.fMask = SEE_MASK_FLAG_NO_UI;
info.hwnd = NULL;
info.lpVerb = _T("open");
info.lpFile = (LPCWSTR) &szCAB;
info.lpParameters = _T("");
info.lpDirectory = _T("");
info.nShow = SW_SHOW;
// Call to perform an action
ShellExecuteEx(&info);
if ((long)info.hInstApp > 32)
{
dwRetVal = WaitForSingleObject(info.hProcess, INFINITE);
switch(dwRetVal)
{
case WAIT_ABANDONED:
iErrCode = 4;
break;
case WAIT_OBJECT_0:
iErrCode = 4;
break;
case WAIT_FAILED:
dwErr = GetLastError();
iErrCode = 4;
break;
default:
iErrCode = 0;
break;
}
}
When running this in debug mode the CAB file being executed has presented the user with a dialog box prompting to overwrite existing files and the WaitForSingleObject has already returned.
Any suggestions?
Thanks.

Install From Storage Card on Insertion
This details info about autoinstalls from a SD card...
But the application is also uninstalled on removal of the card?
http://msdn.microsoft.com/library/d...P/html/sp_programming_pocket_pc_2002_balr.asp

Thankyou but I have already read this, and the above listing is a section of my autorun.exe application. This does not answer the problem I have documented above but thanks for taking time to assist me.

Just to outline, the problem that I am witnessing is that all the CAB files are being opened before the previous CAB installation has completed and the device is being warm booted without all the CAB files being installed. I need to wait in the looping code until a CAB file has completed its installation. The waitforsingleobject call should do this but it appears to fail. The CAB file has been opened succesfully but the error is that an invalid handle has been provided to the call. Thanks for any help

Doh! How stupid am I - please dont everyone reply. The programming error is in that I assign the return value of WaitForSingleObject to a variable. Change the above code snippet from
dwRetVal = WaitForSingleObject(info.hProcess, INFINITE);
to
WaitForSingleObject(info.hProcess, INFINITE);
and remove the switch..case code and it works fine.

Ok. So I now have my autorun.exe program that installs my CAB files but where do I put it in order for it to automatically install after a cold boot? I have tried the .EXE in "\storage card\2577" and in "\storage\2577" neither of them working. Modifying extended ROM is not an option here as this is a commercial package that is distributed on an SD card. I simply want the user to insert the SD card and then do a cold boot that will then install the CAB files. Is this possible and if so how? Thanks.

Got it all working now, the .EXE does go into the SD card subdirectory \storage card\2577.

HI,
Have you (or someOne else) tried to call registry keys (mostly interested in network connections) from this autorun.exe?
Herman

autorun?
what did you use for an autorun.exe??
is the code u put up earlier comilable to an autrun.exe?
(not a coder per se ,but dibble little here and there)
or is it from the sdk?
It it possible for u to post it as a attachment here?

Re: autorun?
lynxlynx said:
what did you use for an autorun.exe??
is the code u put up earlier comilable to an autrun.exe?
(not a coder per se ,but dibble little here and there)
or is it from the sdk?
It it possible for u to post it as a attachment here?
Click to expand...
Click to collapse
The Autorun.exe file can be whatever exe file you want.

that I understand...but what if I wanna install more than 1 thing...I have a list of stuff I wanna do...like a couple of .cab and some .exe´s and maybe a .cpf.....how can I get them all to run automatically on cardinsert....
I gave the code to a programmer at work..I will see what he comes upp with...but I thinkthat there should be somekind of "public" autrun.exe with a .cfg file with it to download here at xda-dev.
If mine works I will post it later...

Related

Auto install of .CAB files from memory card

Dear list,
Sorry if this has been answered in the past.
I am trying to install a CAB file from the memory card. MS documentation state is should be in a directory with the CPU number and called "<Provider> <AppName>.cab" (see autorun.cpp in samples.)
So I create:
\PXA272\my app.cab
Yet this is not installed. Maybe my CPU number is wrong?
If any users have experience of the auto-install method, I would be very interested in hearing from you.
There is a reg hack to point the autorun found in Ext rom as well as the config.txt to some other location.
In the Blueangel forum I opened a thread some thing about auto install (search).
The same info is also on wiki in the BA ext rom kitchen.
Hope it helps
Thanks for the information.
My needs are really for customers running unmodified XDA's. These customers seem to frequently run down their batteries, therefore loosing all programs.
What I really need is an ability to reinstall and run our application from a memory card placed into an unmodified XDA.
Regards,
Ben
I seem to have found the solution
Create a program \2577\autorun.exe on the card.
When the card is inserted the program is run with the parameter 'install'.
When the devise reinstalls, I belive the above is also run.
When card removed, a copy of program run with parameter 'uninstall'.
If you want to install a CAB, use code something like:
CreateProcess(_T("\\Windows\\wceload.exe")
, _T("cab_file.cab"), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
More info at:
http://msdn.microsoft.com/library/d.../html/ppc_programming_pocket_pc_2002_balr.asp
Also sample file autorun.cpp found in PocketPC 2003 installation directory.
Regards,
Ben.

How to make Popup Message on CAB Files?

I received a CAB file from my friend, and when I tried to install it, I found that it has a popup message from my friend telling me a joke...
how he do that?
and how can I change that message?
Still No Comment...!
Please Help!
I asume you know how to make a cab to start with????
As you know there are exported functions in the dll that the cab uses (you make the dll). For example this is the normal look of whats exportd. Bellow is whats in the def file.
--------------------------------------------------------------------------
; TestSetup.def : Declares the module parameters for the DLL.
LIBRARY "TESTSETUP"
;DESCRIPTION 'TESTSETUP Windows CE Dynamic Link Library'
EXPORTS
Install_Init
Install_Exit
Uninstall_Init
Uninstall_Exit
now in the code for one of those you just make a dialog like normal.
The code below is cut out of one of my working cabs. Because its in Install_Init it is the first thing to happen. Changing the method to Install_Exit would give the message after the instalation.
#include "stdafx.h"
#include "TestSetup.h"
#include "ce_setup.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "MyAboutDialog.h"
BOOL CALLBACK gAboutDialogProc(HWND h_dlg, UINT my_message, WPARAM wpAram, LPARAM lpAram);
static CMyAboutDialog* myAbout= new CMyAboutDialog();
BOOL CALLBACK gAboutDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return myAbout->AboutProc(hWnd,uMsg,wParam,lParam);
}
/////////////////////////////////////////////////////////////////////////////
// CTestSetupApp
BEGIN_MESSAGE_MAP(CTestSetupApp, CWinApp)
//{{AFX_MSG_MAP(CTestSetupApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTestSetupApp construction
CTestSetupApp::CTestSetupApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CTestSetupApp object
CTestSetupApp theApp;
/////////////////////////////////////////////////////////////////////
codeINSTALL_INIT
Install_Init( HWND hwndParent,
BOOL fFirstCall,
BOOL fPreviouslyInstalled,
LPCTSTR pszInstallDir )
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
DialogBox:AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDD_AboutDIALOG),
hwndParent,
(DLGPROC)gAboutDialogProc);
return codeINSTALL_INIT_CONTINUE;
}
//------------------------------------------------------------------
Of course the detail of the dialog is in the MyAboutDialog. You just make your own to do what you want.
You can do just about anything from the code you put in the cab's dll, but a lot of the instalation should be left up to cabwiz to generate. What ever you do put in the dll will permanently reside in the windows folder until the user removes the program, so don't make it too big.
Thanks Dear OdeeanRDeathshead...
your reply is more than an informative article.
however, I hope if you can answer my second part of the question...
how can I remove the message from a CAB file that i have?
I you want to remove the message on an existing cab then that is more complicated. If you know everything that the cab dose when it gets tapped (eg registry changes etc) then you could gather all the file that the cab installs and use them to re-write them into a new cab that has no messages. This is more trouble than its worth. Unless your friend is willing to give you detailed info on what his cab dose you would be bound to miss something.
Also many messages are as a result of the os, and these vary depending on the version of os. You can't stop some of those (on every platform).
Most people would not want their instalation packages tampered with.
Try to extract the .cab file with Win CE Cab manager. Remove the Setup.dll, hopefully it does not do anything else then showing the joke Then build your own version of it.
for any complex instalation I doubt that doing that would leave you with a working instalation. Still its worth a go if it saves time. What I would like to know (not having vis studio 2005 yet) is why dose the wm2005 device always ask where you want to put the software even when you have turned this feature off? When one's coding gets a bit lazy it can all fall appart when put in a location other than that you expect.
OdeeanRDeathshead, I assume you are referring to whether to install to main memory or to SD question (this dialog pups up on WM5 device with SD inserted or built in storage).
To avoid it remove the InstDir string from your inf file (or change the string name to something else). This will force the software installation to the directory you specify in the cab.
I did not want to hard code the directory, so I used
InstallDir="%CE2%"
That should get the location of the windows folder for the install. Are you saying that if I just put
InstallDir="\windows\"
it will force it there. Dose this mean that there is a new table of Windows CE Directory Identifiers or that installs just always ask if you use them?
No, what I meant was you don’t want a string call 'InstallDir' in your inf file.
The 'InstallDir' is just a string definition you may or may not use later in the inf (like #define in C).
What determines where the files are installed is what's in the [DestinationDirs] section.
For example:
Files.Windows = 0,%CE2%
You should delete the line InstallDir = completely from your inf file, or if this string appears else where (except [CEStrings] section) just change it to something like MyDir= (be sure to change it every ware it appears in the file)

ReLoad v0.1 Beta

ReLoad
This is a MortScript script written to simplify reinstalling cab files, and restoring files back to the device from a zip file on the trinity.
More information about MortScript at http://www.sto-helit.de
-v.01 Initial Release
Known Issues
-Cab files that initiate the installation of another cab file ie.Wisbar Advanced
-How to setup:
1)Extract Reload.rar to your storage card.
2)Place cab files in the CabsAuto folder if you want to the cab to be automatically installed to the device (installation to automatically install to the storage card is currently not available).
3)Place cab files in the CabsManual folder if you want to be able to choose where to install the cab.
4)Place file in the Backup.zip file that you want to be restored.
ie. If you wanted example.jpg to be placed in the \Windows folder, place example.jpg in the Windows folder of the zip file.
*Please note that the cab files placed in the CabsAuto folder need to conform to only asking the user for the installation destination, then showing installation successful/unsuccessful. Otherwise you might encounter some
problems. You should place cabs that don't conform in the CabsManual folder, or adjust these cab files with programs such as WinCE CAB Manager.
-How to use:
1)In the Reload folder, execute Run1st. Click ok the the window that pops up. This just installs MortScript
2)Execute Run2nd. This will initiate the script that will first install the CabsAuto, then CabsManual, and finally restore the files in the zip file.
Use at your own risk.
Download
http://rapidshare.com/files/29964511/Reload.rar.html
Thx, that's a good idea.
is there a way to have it restore registry entries from a .reg file?
Is there a way to install certain cab files on RAMDisk/Storage card without individually clicking the install option??
@racerx_
Currently there isn't a way to restore the reg file directly. But you can create a cab from the reg file and then have that cab automatically installed.
MortScript wasn't able to read in the reg files i saved with resco explorer, so I gave up on doing it this way. For right now the easiest way is to create a cab file with WinCE Cab Manager.
@c_shekhar
The best way to install the program to the Storage Card, backup the reg (and any possible files installed on rom), then create a cab from this.
This post has alot of good information on this.
http://forum.xda-developers.com/showthread.php?t=277727
yeah, i've been trying like a madman to get win ce cab manager to make a cab of my .reg file.. but when i click on 'import' and try to grab the .reg file it tells me it's only for registered versions of the program.. is there another way i'm not seeing? cause right now the only other options i see for registry entries is to manually create them one by one which doesn't sound very exciting hah
thanks for the help..
@racerx
What OS and version of WinCE Cab Manager are you running. I heard of some problems with the newest version of WinCE Cab Manager with Vista. I am running version 2.1.0.35.
If that isn't it, you might have run the program past its initial trial use.
hmm.. Win Ce CabManager is 2.1.0.50 running on xp.. still got 17 uses left.. sigh..
Maybe i missed something. Just in case, what button or command are you using to get your .reg file into WinCE? I was using the 'file' 'import' command.
@racerx
That's the same way I do it. I would find an older version and try it again.
Reload V0.2
I made a couple of changes to the script for a rom we are going to be releasing soon...it checks if Backup.zip exists and only does the unzip if it does...I also added a SDBackup.zip for files to unzip to Storage card (specifically exe's and dll's I've already upx'd to shrink them but reinstalling the cabs replaced them again so this puts them back)....
#ReLoad
#v.02 Initial Release
#Use at your own risk.
#v.02 Extract files from SDBackup.zip to Storage Card
If(Question("Do you want to ReLoad?", "Reload 0.2", "YesNo")="No")
EXIT
EndIf
Run("Storage Card\ReLoad\Bin\Message_Running.mscr")
RegWriteDWord("HKLM", "Comm", "AutoRunFlag", "0")
RegWriteString("HKLM", "Comm", "AutoRunCFG", "\Storage Card\ReLoad\CabsAuto\Config.txt")
#Create Config File
Delete("\Storage Card\ReLoad\CabsAuto\Config.txt")
WriteFile("\Storage Card\ReLoad\CabsAuto\Config.txt", "SHOW:\Storage Card\ReLoad\Bin\ReLoad.bmp^NL^")
ForEach x in files { "\Storage Card\ReLoad\CabsAuto\*.cab" }
WriteFile("\Storage Card\ReLoad\CabsAuto\Config.txt", "CAB: ", 1)
WriteFile("\Storage Card\ReLoad\CabsAuto\Config.txt", x, 1)
WriteFile("\Storage Card\ReLoad\CabsAuto\Config.txt", "^NL^", 1)
EndForEach
#CabsAuto Install
RunWait("\Storage Card\ReLoad\Bin\AutoRun.exe")
#CabsManual Install
ForEach x in files { "\Storage Card\ReLoad\CabsManual\*.cab" }
RunWait(x)
EndForEach
If (FileExists("\Storage Card\ReLoad\Backup.zip") )
#Restore files from zip to main storage
UnzipAll("\Storage Card\ReLoad\Backup.zip", "")
EndIf
If (FileExists("\Storage Card\ReLoad\SDBackup.zip") )
#Restore files from zip2 to storage card
UnzipAll("\Storage Card\ReLoad\SDBackup.zip", "\Storage Card\")
EndIf
KillScript("\Storage Card\ReLoad\Bin\Message_Running.mscr")
If(Question("Finished ReLoading.^NL^Do you want to reset?", "Reload 0.2", "YesNo")="No")
Exit
EndIf
Reset
Very good soft, it works nice !!
The only difficulty for the french users is to replace in the script "Storage Card" by "Carte de stockage"
Thx men for this !!!
Nice soft,
I could use FAMAN WM6 on my trinity now !
French translation and modification is (seem to be) ok.
Just wait the OK from the boss and I'll give you !
Edit : Why don't you use the LOCK:Enabled in the header and LOCKDisabled on the end of the config file ? Thxs in advance.
I use SettingsSavior on my Trinity mainly for its similar auto-install functionality
Hello,
Thank you for this very useful tool
My .cab are removed after using Reload. How can I keep my .cab on my SD after a new installation ?
Thank you for your help.
Guillaume
__________________
SPV M700
FAMAN 4.03.FR
1.50.08.11
2.79.7020.19H
can this software reinstall cabs, copy skin files in programs installation directory (eg pocketcm skin) and reconfigure mail and exchange accounts ?
OOPS delete this post.

OziExplorerCE: Registration key reset turning off the GPS

Hello,
I installed OziCe in my GPS Invion (wince 4.2 loaded from SD card). It
works fine but, every time I turned on the GPS, OziCE asks to re-enter
the registration code. All the other configuration are correctly
reloaded, togheter with last used map.
No problem exiting and restarting OziCE, when the GPS remains active.
It seems that OziCE saves the registration code in same 'volatile'
memory, not flashed at hard shutdown.
I tried to check the registry, comparing them with remote tools before
and after starting OziCE, but I foung nothing.
Does anyone know a way to solve or workaround the problem?
Thanks, Filippo
Found a solution
Hello,
for who may be intersted, I found a way to workaround the issue writing a MortScript (download the interpreter and instructions from http://www.sto-helit.de/).
This is the script I wrote; obviously you have to change the OziCE username and password and the path to OziExplorerCE.exe.
After insatalled and registered MortScript, copy the script in a .mscr file in the device. Executing the script would start OziCE inserting the registration code (if needed).
Ciao.
#OZI CE start
regName = "MyOZICeUserName"
regKey = "MyOZICeRegistrationCode"
WindowTitle="Inserisci Codice di Registrazione"
EngWindowTitle="Enter Registration Code"
OKWindow="OziExplorer"
ozipath = "\SDMMC DISK\WINCE\programfile\ozi_1.12.3\COMMON\OziExplorerCE.exe"
nLoops = 200
Run(ozipath )
#WaitFor(WindowTitle, 5) #returns timeout error if not found...
i=0
While ((ActiveWindow() ne WindowTitle AND ActiveWindow() ne EngWindowTitle) && i<nLoops)
Sleep(50)
i=i+1
EndWhile
if (WndActive(WindowTitle)=1 OR WndActive(EngWindowTitle)=1)
actWin = ActiveWindow()
SendKeys(actWin, regName)
SendTab(actWin)
SendKeys(actWin, regKey)
SendCR(actWin)
#WaitFor(OKWindow, 5)
i=0
While (ActiveWindow() ne OKWindow && i<nLoops)
Sleep(50)
i=i+1
EndWhile
if (WndActive(OKWindow)=1)
SendOK(OKWindow)
EndIf
EndIf
using mortscript to enter OZICe on a windows CE 4.2 device
Filippo, nice work!
That mortscript you wrote works a treat on my navigation box.
I was unable to work out how to do a cab instal of mortscript. My navigation box won't start .cab files. So I need to run the bin:version of mortscript first for the Device binaries (whatever that means) and then I can run your mortscript. Love watching mortscript typing in my name and code.
OziCe now asks for ECW.dll - where does that file come from and where should it be? in windows? in storage card root? in oziexplorer folder on storage card? in nandflash?
OziExplorerCE: Preventing registration key reset turning off the GPS
Please apologize warming up this thread, but thought I'ld share my solution here.
1. OziExplorer stores user-registration data in file named 'gihobj.dll' in OS's folder \Windows.
2. Hence you backup once this 'gihobj.dll' , then always copy it to \Windows before you start OzExplorer.
I suggest to use a wrapper script as following to start OziExplorer:
Code:
#OziExplorer Launcher
#This script must be located in OziExplorer's installation folder
#or you have to alter the OziExplorer 'ozipth' below!
Local()
ozipth=SystemPath("ScriptPath")
oziexpl="OziExplorerCE.exe"
regdata="gihobj.dll"
winregfile="\Windows\"&regdata
bkupregfile=ozipth\regdata
#check existence of registration data
If(FileExists(winregfile))
#OK, run OziExplorer
Run(ozipth\oziexpl)
ElseIf(FileExists(bkupregdata))
#OK, but in wrong folder, hence copy registration
#data to \Windows, then run OziExplorer
Copy(bkupregdata,winregdata,1)
#wait max. 2 secs
cnt=0
While((NOT FileExists(winregdata))&&(cnt<20))
cnt+=1
Sleep 100
EndWhile
Run(ozipth\oziexpl)
Else
#not OK, hence start OziExplorer with entering user-registration data
RunWait(ozipth\oziexpl)
#backup OziExplorer's registration data
If(FileExists(winregdata))
Copy(winregdata,bkupregdata,1)
EndIf
EndIf
HTH
OziExplorerCE: Preventing registration key reset turning off the GPS
Hello,
I have an old pda with WindowsCE 2002 installed.
Can everyone drive me applying the suggest of jwoegerbauer?
I can't find the file 'gihobj.dll' I think because I don't see the hidden files so:
1. how can I see the hidden files.
2. how can I create the script file? is it a batch file?
many thanks at all,
mimmolo
mimmolo said:
Hello,
2. how can I create the script file? is it a batch file?
mimmolo
Click to expand...
Click to collapse
All you need is MortScript: http://www.sto-helit.de/index.php?module=page&entry=ms_overview&action=view&menu=29

mousio's AutoRun

[ Based on plenTpak's already great AutoInstall4 (2008/03/28) ]
The scripts included here require MortScript and are intended to help automatically install and configure software, copy files and folders, and import registry and provisioning stuff - this all with little or no user interaction!
So should you need to install a new ROM or install new software versions, just go ahead and let User Customization take care of the rest...
Usage:
Unpack SDConfig.txt and scripts to storage card (and review them )
Dump any install files (silently installable only!), script files (e.g. to process the interactive install files, see further), registry files, provisioning files, and files and folders to copy, into the AutoRun subfolder.
Hard-reset, or start the RunAutoRun script
Hope this makes things easier for some people!
By default, it uses this file structure:
Code:
_ Storage Card\
|_ SDConfig.txt
|_ SDConfig\
|_ <MortScript cab>
|_ AutoWait.mscr
|_ AutoRun.mscr
|_ AutoRun\
|_ <your stuff here>
I rarely need to change my SDConfig file anymore and I just drop all of my AutoRun stuff (cab/mscr/zip/reg/xml files and also regular files and folders) in the dedicated AutoRun folder, it's that easy!
The AutoRun folder may contain any or all of the following:
cab files to install silently and mscr scripts to run,
regular files/folders to copy,
zip archives to unpack,
reg files to import,
xml files to concatenate.
All is processed (and logged!) in the same order as listed above, with all items sorted alphabetically first.
After installing, files are copied/unpacked, then registry files are imported, and finally the xml files are concatenated into a single provisioning file that is called by SDConfig.txt.
Here are some important notes for each item:
I use scripts to install the more interactive cabs: e.g. instead of putting Fringcab.cab here, I put a Fringcab.mscr here, and move Fringcab.cab elsewhere (i.e. a sibling folder called "Interactive"); my Fringcab.mscr installs Fringcab.cab but then also takes care of the interactive installation part of it.
The "regular" files are files that do not fit the other categories (cab/mscr/zip/reg/xml); regular files/folders found here will be xcopied to the root folder on the device (creating folder structure if necessary) - quite like plenTpak explained here.
Zip archives are unpacked to the root folder on the device (creating folder structure if necessary); zip archives are smaller to store, but unpacking is less tolerant than xcopying when it comes down to read-only or system files and such...
Not thoroughly tested the registry import since I use xml files for registry changes also; if I recall correctly from my brief testing, I believe the reg file should not be unicode for the script to be able to parse it correctly, so mind the encoding!
A provisioning file is always generated, so that SDConfig does not fail on a missing file.
About the AutoWait script: see here and here. To summarize roughly: 1 AutoWait call is needed for each full 3-minute block that your AutoRun requires to run. Apart from extra run time, it will not do any harm to add extra AutoWait calls to your SDConfig file.
Remark: The AutoRun script can take a parameter to use a custom sibling folder instead of the default AutoRun folder (e.g. a folder "Games"), but I failed to pass that parameter directly from SDConfig. However, yet another script can take care of that, as follows:
create a script for each custom folder (e.g. a script "Games.mscr"), with the following contents:
Code:
CallScript( SystemPath("ScriptPath") \ "AutoWait.mscr" )
CallScript( SystemPath("ScriptPath") \ "AutoRun.mscr", SystemPath("ScriptName"), "^NL^^NL^ processing " & SystemPath("ScriptName"), & "..." )
adapt the SDConfig.txt file to copy and call the new script(s) just created (which in turn will call the original AutoRun script, so do not forget about AutoWait here too!)
A RunAutoRun script is also included in the zip file, to test the SDConfig/AutoRun without hard-resetting your device.
Personally, I use MortScript-4.11b7-PPC.cab and these scripts together with ROMS using SDAutorun v2.0 - and I only have my Trinity to use it on.
Main related links:
MortScript
AutoInstall4
User Customization
SDAutoRun v2.0
Use all at your own risk!
[ reserved ]
The script does not check if it is run manually or automatically, nor does it check the mortscript version it runs with, nor does it actively try to avoid double installation of mortscript, but feel free to post your own code to include these interesting features. Another feature could be to automatically detect the name of the storage card root folder in order to support different languages...
thank you mousio tested with xml, cabs, and folder/files.. very good
Great idea! Automating the automated process of SDAutoRun!
Taking the automated process to next level . AWESOME!!! . you developers are not going to let me get me out of cooking frenzy
The script does not check if it is run manually or automatically, nor does it check the mortscript version it runs with, nor does it actively try to avoid double installation of mortscript, but feel free to post your own code to include these interesting features. Another feature could be to automatically detect the name of the storage card root folder in order to support different languages...
Click to expand...
Click to collapse
If I can find some spare time for this...
Thanks for this tool!
I've only got one issue with it, and that is AutoWait related. It seems that after 6 minutes (I'm installing a lot of cabs), SDAutorun continues to execute the rest of SDConfig.txt, it complains about a missing AutoRun.xml (as the AutoRun.mscr hasn't generated it yet), then the device hangs.
Reading your instructions, it seemed that the solution would be to add more lines of EXEC:\Temp\AutoWait.mscr to the SDConfig.txt, but this appeared to have no effect at all!
If there is any other possible solution for dealing with long-running scripts, I'd love to hear it.
Alex
Would splitting them up into sub scripts work better?
Cuts down the time for each script, but may be more complex.
mousio said:
If I can find some spare time for this...
Click to expand...
Click to collapse
Here is the code that seems to work for me with regard to StorageCard location for international people.
Code:
# STORAGE CARD PATH
Sub StorageCardLogic
If (Length(RegRead("HKLM","System\StorageManager\Profiles\SDMemory","Folder")) > 0)
StorageCardPath = "\" & RegRead("HKLM","System\StorageManager\Profiles\SDMemory","Folder")
ElseIf (Length(RegRead("HKLM","System\StorageManager\Profiles\SDMMC","Folder")) > 0)
StorageCardPath = "\" & RegRead("HKLM","System\StorageManager\Profiles\SDMMC","Folder")
ElseIf (Length(RegRead("HKLM","System\StorageManager\Profiles\PCMCIA","Folder")) > 0)
StorageCardPath = "\" & RegRead("HKLM","System\StorageManager\Profiles\PCMCIA","Folder")
EndIf
EndSub
Storage Card logic
Long time no post
Based on several sources, including yours, this is now similar to what is in my latest version:
Code:
RegStorageCard1 = RegRead( "HKLM", "System\StorageManager\Profiles\SDMemory", "Folder" )
RegStorageCard2 = RegRead( "HKLM", "System\StorageManager\Profiles\SDMMC", "Folder" )
RegStorageCard3 = RegRead( "HKLM", "System\StorageManager\Profiles\PCMCIA", "Folder" )
RegInternalStorage = RegRead( "HKLM", "System\StorageManager\Profiles\moviNAND", "Folder" )
RegAutoPart1 = RegRead( "HKLM", "System\StorageManager\Profiles\moviNAND", "AutoPart" )
RegAutoPart2 = RegRead( "HKLM", "System\StorageManager\Profiles\moviNAND\FATFS", "AutoPart" )
If( RegAutoPart1 = 1 || RegAutoPart2 = 1 )
storagecard = "\" \ RegInternalStorage
ElseIf( NOT IsEmpty( RegStorageCard1 ) )
storagecard = "\" \ RegStorageCard1
ElseIf( NOT IsEmpty( RegStorageCard2 ) )
storagecard = "\" \ RegStorageCard2
ElseIf( NOT IsEmpty( RegStorageCard3 ) )
storagecard = "\" \ RegStorageCard3
Else
storagecard = "\Storage Card"
EndIf

Categories

Resources