I’ve received many questions about why the destination dialog screen is needed at all and what makes it better than CabInstl. Well, it indeed has advantages if you need to do a mass-install from your desktop computer onto your storage card and want to install all your software into a common subdirectory (and not the default, that is, the root directory). Then, using the hack does indeed save a lot of time.
What I wasn’t aware of while writing the above tutorial
(and giving the thread a title
) is the bugginess of the redirection
The main disadvantage is that, unless you use registry toggler tools (more on this later in the section on nscript
) to easily switch between the enabled/disabled state of the destination dialog screen, the installer of some programs just won’t work: the PPC will be reset as soon as the CAB is started on the PPC.
Some examples of apps that behave like this:
All games of Astraware; I’ve tested Bejeweled (tested version 2.45; http://www.astraware.com/download/bejew ... -v2-45.exe
) and Bejeweled 2 (tested version 1.2; http://www.astraware.com/download/bejew ... c-v1-2.exe
They, however, work great if you install them through ActiveSync or CabInstl (tested with the latest version, 1.04). That is, there’re cases (Astraware games etc) when using CabInstl is the only way to get some programs installed to non-RAM media without access to a desktop ActiveSync.
Please note that this is not a bug in Mad Programmer’s File Dialog Changer but that of the Windows CE install-time dialog box redirection.
I need to point out another problem with enabling the destination dialog screen
(again, with or without File Dialog Changer – it’s another bug in WindowsCE): the alternative screen will only be activated if you give a non-RAM target to ActiveSync. This will, of course, result in (in cases, far) slower transferring of the initial CAB file to the device, especially with larger CAB files (for example, that of Adobe Acrobat 2.0). If you don’t like the decreased speed introduced by this hack, you may want to stick to the default configuration (with or without CabInstl).
: that is, I need to elaborate on the title of the the thread: it would be
a killer if it worked
with every CAB’s and with CAB’s (auto)copied into main memory. For the time being, you may want to stick to CabInst for offline installations or installations that require a common, non-root directory on your storage card (despite the need for hunting for ActiveSync-created CAB’s on the desktop in the latter case).
You may, despite the problems I’ve outlined above, still want to use the destination dialog screen (with or without the Mad Programmer utility), but want to make it easily switchable. If that’s the case, read on.
First, I elaborate a bit more on the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Apps\Microsoft Application Installer\fAskDest
If you don’t copy the two Mad Programmer files to your PDA (and enable the new file dialog), just enable this key (0 -> 1), you’ll get the following screen each time a CAB is started either locally (by, say, clicking it) or by a remote ActiveSync process:
Here, you can choose in which directory to install your app and on which card. This may be enough for most purposes if you don’t need, for example, built-in directory creation capabilities
or multilevel directory tree navigation
(both are offered by the Mad Programmer tool) because you already have the target directory (for example, \progs
on your storage card) to install your files to and don’t mind the “flat”, one-dimensional format of the “Folder
” drop-down list.
Now, the important part: how can you quickly disable and enable the automatic destination dialog screen because of the problems with certain CAB’s and the need for telling ActiveSync a slower destination for the dialog screen to work?
It’s, fortunately, very easy. No, you don’t need to fire up a registry editor, go to HKEY_LOCAL_MACHINE\SOFTWARE\Apps\Microsoft Application Installer\fAskDest
and change the registry values every time you want to enable/disable this feature.
Nor need you define two registry import files to enable/disable redirection. (I’ve described a quick way of switching some values in the registry in my article here
. This article describes implementing registry import-based solutions for problems that can be done with reg. imports - for example, as far as my tutorial is concerned, easy and fast HTTP proxy changing/enabling/disabling.) That’s much cleaner but still involves two
files because they don’t contain any conditional execution logics: code that reads the current value of HKEY_LOCAL_MACHINE\SOFTWARE\Apps\Microsoft Application Installer\fAskDest
and negates it.
Going the ‘let’s write a program in native/managed code to toggle between the two states’ is indeed easy, but definitely not as flexible (you can’t recompile it on your PDA; the EXE sizes are considerably larger than script sizes; distributing these files aren’t as easy as script files which can be checked for “viruses” and “backdoors” by anyone etc) as the one I’ll describe.
nscript to the rescue!
(Please note that the latest version is 0.88 – their homepage still refers to 0.86, but the ZIP there already contains 0.88!) This utility was written by the same S_K people that wrote CabInstl and a lot of other great tools.
It offers a lot of features, including registry read/write, conditional logics, message boxes etc. The only missing feature is, IMHO, WinCE database read/write, but that’s not a big problem (for comparison: not even the Compact Framework 2 supports full access to all
WinCE system databases, let alone 1.0/1.1, which have no way of accessing them without using native system calls).
Furthermore, its script programming code constructs (if/while/for
; code blocks etc.) resemble C (and, therefore, Java, C#, C++) a lot. This means you don’t even need to read the docs of the tool to be able to become productive in it
if you already know at least one of those languages.
To install NS, you will need to uncompress ARMPPC\ns.exe
from it and copy it anywhere on your PDA (preferably in \Program Files or on a non-RAM medium). It has no installer, so you will need to set file associations yourself: associate the ns
file association with ns.exe. To do this, you may want to read my posts here
on using Resco File Explorer
. Note that you’ll need to create a new entry for .ns
files in myExtensions
if you use that tool. Furthermore, if you prefer direct registry editing/imports (instead of using Resco File Explorer
for extension mapping), you will need to import the following keys/values into the registry:
Note that you can assign a different icon to ns.exe if you accordingly set the default value of [HKEY_CLASSES_ROOT\nsfile\DefaultIcon].
Then, you only need to transfer a file with the .ns extension and the following contents to your PDA:
- Code: Select all
subkey="\\SOFTWARE\\Apps\\Microsoft Application Installer";
if (val == 0)
puts("Install redirection ON");
puts("Install redirection OFF");
16 lines; 3 keywds; 3 nums; 42 ops; 9 strs; 0 coms Syntactic Coloring v0.4 - Dan East
What does this code do? After initializing two string variables, it reads the value of our registry key by giving a call to the rggetvalue()
function. Note the val
variable (it can be named anything!). The return value of rggetvalue()
will be copied in it. Based on this return value, we go for insertng 0 or 1 to fAskDest
. See how similar it is to C (except for being weak typed)? Yes, it’s really great to code in this language if you’re a C/C#/Java/C++ guru! Not another f**** up scripting language syntax to learn!
After the file is copied to your PDA, you can just execute it by simply clicking it. ns.exe
will be invoked, the new state will be displayed for a second (so you’ll be able to see whether the redirection is off or on) and then, NS exits. You don’t need to click anything, unlike with the registry import-based solution: you may know that you do need an additional click after the registry file is imported with all the regimport-capable registry editors. And, the need for two registry files is also a showstopper as far as the registry import file-based solution is concerned, while, in this case, you only have only one.
Please note that you can even put shortcuts to your .ns
files (as, for example, this one) on your Today screen with, say, Spb Pocket Plus 2.x+ (I’ve described this it in the above article on the registry import-based solution) or with the free (!!) PHM TrayLaunch PowerToy
. With the latter, after installing the program (you may need to copy c:\Program Files\PHM\PHM Pocket PC PowerToys\PHMPPCPT.Rpr_ARM.CAB to your device and execute it there to actually install the app – as with several other PHM apps, their MSI installers don’t fire up the actual installation in ActiveSync with WM2003+ devices), go to Settings/System/Admin. Tools/PHM TrayLaunch
, enable the Enable TrayLaunch
checkbox and click Add
. Here, enter the full path (!!) of the .ns file like below:
After this, press OK. You should now see your script listed in the PHM TrayLaunch main screen:
And the newly-added icon should also be displayed in the tray (at the bottom right; the new icon is the leftmost):
Are there alternatives to nscript as a great client-side scripting tool?
, while it’s a great scriting utility, still (as of version 2.6, released 20 July) doesn’t have the same functionality as nscript. For example, it can’t read
(only write, delete and check for existence – in this case, where we need to read a value of an already-exiting subkey, it’s useless) registry values. It doesn’t know data types except DWORD and String either. Furthermore, it uses a scripting language that is not as similar to C as nscript
The Pocket PC console tools described in my article
, much as some has (semi-)decent scripting capabilities don’t offer so good a system access than nscript or even MortRunner. They only have rudimentary programming contructs – the MS-DOS (if they implement them at all) batching capabilities are very limited. Furthermore, they can’t access the registry, can’t display dialog windows etc.