Windows Mobile Cab File Installer (via autorun.exe / Managed Code)
Das habe ich schon lange gesucht, mittlerweile bei Sebbi.de gefunden, aber noch nicht getestet: Wie man Cab – Dateien auf Windows Mobile Geräten installiert. Irgendwann komme ich auch noch zum testen.
01.usingSystem;
02.usingSystem.Collections.Generic;
03.usingSystem.Text;
04.usingSystem.Windows.Forms;
05.usingSystem.IO;
06.usingSystem.Diagnostics;
07.
08.namespaceMyInstaller
09.{
10.classProgram
11.{
12.staticvoidMain(string[] args)
13.{
14.if(args.Length > 0 && args[0] =="install")
15.{
16.// Get the code directory of this application
17.stringFullPath = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
18.// Split the path and find the storage card name used
19.string[] Tokens = FullPath.Split('\\');
20.if(Tokens.Length < 2)
21.{
22.MessageBox.Show("This application should be started by the system");
23.return;
24.}
25.
26.stringStorageCardName = Tokens[Tokens.Length - 2];
27.
28.string[] CabFiles = Directory.GetFiles(Path.DirectorySeparatorChar + StorageCardName,"*.cab");
29.
30.if(CabFiles.Length == 0)
31.{
32.MessageBox.Show("Couldn't find installable CAB-file on the storage card ("+ Path.DirectorySeparatorChar + StorageCardName +")");
33.return;
34.}
35.
36.stringFirstCabFile = CabFiles[0];
37.
38.Process.Start(FirstCabFile,"");
39.
40.}
41.}
42.}
43.}
Windows Mobile Cab File Installer (via autorun.exe / Managed Code) | Sebbis Blog