Posted on 9th July 2009No Responses
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.using System;

02.using System.Collections.Generic;

03.using System.Text;

04.using System.Windows.Forms;

05.using System.IO;

06.using System.Diagnostics;

07.

08.namespace MyInstaller

09.{

10. class Program

11. {

12. static void Main(string[] args)

13. {

14. if (args.Length > 0 && args[0] == "install")

15. {

16. // Get the code directory of this application

17. string FullPath = 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. string StorageCardName = 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. string FirstCabFile = CabFiles[0];

37.

38. Process.Start(FirstCabFile, "");

39.

40. }

41. }

42. }

43.}

Windows Mobile Cab File Installer (via autorun.exe / Managed Code) | Sebbis Blog

Comments
Leave a Response
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>