x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

launching ceopener with Mortscript on the Sharp brain gen 2

hassilon Page Icon Posted 2024-01-05 4:13 AM
#
Avatar image of hassilon
Subscribers
Factorite (Elite)

Posts:
101
Location:
United StatesĀ 
Status:
I have discovered that ceRestorer has some big disadvantages compared to ceopener on older gen 2 Sharp Brain:

1. There is no way to type a space because ceRestorer assumes the presence of an (unshifted) space key like in gen 3, but there isn't one.
2. Slower startup than ceopener.
3. No easy way to remap keys. (The free key remapper okey.exe won't work.)
4. No use of the lower screen.
5. Some applications are partially obscured by the taskbar in cerestorer but not in ceopener.
6. No easy brightness control.
7. More complete control panel still sucks b/c you have to back up every single change in a .reg file. You can get the full control panel in ceopener if you run the Tronik version (included with miosoft for brain.)

Most of what I like about cerestorer is done in the Mortscript file Appmain_.mscr that runs at startup For example, importing .reg files (mostly so I don't have to reinstall ms ent pack games and get file associations) is done like this:

# Plugin1.exe is just regedit.exe # SysPath is where you put ceRestorer. ForEach RegFile in files(SysPath\"Windows\Registry\*.reg") runwait(SysPath\"Scripts\Plugin\Plugin1.exe" , "-s " & """" & RegFile & """") EndForEach


The mortscript works as expected outside of cerestorer, at least the parts that do system font patching and apply .reg files. I commented out the parts of AppMain_.mscr that copy (modded) explorer.exe to \Windows and instead run ceopener.exe

But in order to start ceopener this way, I have to first start explorer in TestCE, run mortscript.exe, then run the AppMain_.mscr script. Is there no way to wrap this up in one command/click?


 Top of the page
stingraze Page Icon Posted 2024-01-05 7:41 AM
#
Avatar image of stingraze
Subscribers
H/PC Vanguard

Posts:
3,688
Location:
Japan
Status:
Yes, I think you can do that.
I don't know anything about mortscript, but here's a general way to do it.

Create a batch script that does this:
1. Make the mortscript.exe run the .mscr file by passing argument (path to the .mscr script you want to run) to it.
Hint: You can do that, it seems, as it is explained below:
On many devices, MortScripts can't be executed directly. Instead, you have to invoke MortScript.exe with the script as parameter, e.g. RunAt( starttime, SystemPath( "ScriptExe" ) \ "MortScript.exe", """" & SystemPath( "ScriptPath" ) \ "notify.mscr" &

Above code for reference:
Pg. 26 of the manual here:
https://www.hjgode.de/dev/files/MortScript-Manual.pdf

2. Make a shortcut on Desktop to run this batch script via cmd.exe etc.

Abstract view of the batch script:
cd \Path to MortScript.exe\ MortScript.exe notify.mscr


Some stackoverflow that may be useful:
https://stackoverflow.com/questions/27901042/create-a-batch-file-to-run-an-exe-with-an-additional-parameter
https://stackoverflow.com/questions/55353882/why-doesnt-my-batch-file-work-in-windows-ce

Just my thoughts.
-stingraze



Edited by stingraze 2024-01-05 8:07 AM
 Top of the page
watamario15 Page Icon Posted 2024-01-05 10:04 AM
#
Avatar image of watamario15
Factorite (Senior)

Posts:
85
Location:
Japan
Status:
If you just want to skip TestCE and run your MortScript program right from the dict app (the "Apps and Videos" menu), put your script (AppMain_.*), necessary files (your .reg files and whatever), AppMain.exe, and index.din in a folder which is right under the "APURI" (in Katakana) folder. The resulting structure should be like the following:

\Storage Card\APURI(in Katakana)\Init(whatever is fine)\AppMain.exe \Storage Card\APURI(in Katakana)\Init(whatever is fine)\AppMain_.exe \Storage Card\APURI(in Katakana)\Init(whatever is fine)\AppMain_.mscr \Storage Card\APURI(in Katakana)\Init(whatever is fine)\index.din


The dict app searches apps in this place and lists them, and it will run the AppMain.exe of the selected app.

If you are going to use it on gen 2/3 machines and not on gen 4, you can remove AppMain.exe and instead rename AppMain_.* into AppMain.* . The AppMain.exe in CERestorer is just a wrapper that hacks the protection into running an unofficial app (named AppMain_.exe) on gen 4.

Edited by watamario15 2024-01-05 10:47 AM
 Top of the page
hassilon Page Icon Posted 2024-01-05 3:39 PM
#
Avatar image of hassilon
Subscribers
Factorite (Elite)

Posts:
101
Location:
United StatesĀ 
Status:
Thank you, Watamario15! That worked.

Just in case anyone else tries it with gen 2 or 3 Brain here is a list of what's needed in the ceopener folder:

1. Rename ceopener's AppMain.exe to ceopener.exe (or whatever, just not AppMain.exe)
2. Copy AppMain_.exe from Cerestorer to AppMain.exe
3. AppMain.mscr (Your mortscript to do stuff, then launch ceopener.exe)
4. MortScript.exe

This method could be used to wrap any program in a MortScript and launch it from the Dict App.
 Top of the page
Jump to forum:
Seconds to generate: 0.175 - Cached queries : 61 - Executed queries : 9