Autor Beitrag
Raorkon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 86
Erhaltene Danke: 1



BeitragVerfasst: Fr 05.06.09 10:56 
Hallo zusammen ich habe nun mein update-Programm soweit fertig. Der Download der updatedatei erfolgreich, und nun starte ich das Programm folgendermaßen:

ausblenden volle Höhe C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
class SHELLEXECUTEEX
{
            public UInt32 cbSize;
            public UInt32 fMask;
            public IntPtr hwnd;
            public IntPtr lpVerb;
            public IntPtr lpFile;
            public IntPtr lpParameters;

            [MarshalAs(UnmanagedType.LPTStr)]
            public string lpDirectory;

            public int nShow;
            public IntPtr hInstApp;

            public IntPtr lpIDList;
            public IntPtr lpClass;
            public IntPtr hkeyClass;
            public UInt32 dwHotKey;
            public IntPtr hIcon;
            public IntPtr hProcess;
}            

string docname = GetCurrentDirectory() + @"update.cab";
int nSize = docname.Length * 2 + 2;
IntPtr pData = LocalAlloc(0x40, nSize);
Marshal.Copy(Encoding.Unicode.GetBytes(docname), 0, pData, nSize - 2);
SHELLEXECUTEEX see = new SHELLEXECUTEEX();

see.cbSize = 60;
see.dwHotKey = 0;
see.fMask = 0;
see.hIcon = IntPtr.Zero;
see.hInstApp = IntPtr.Zero;
see.hProcess = IntPtr.Zero; ;
see.lpClass = IntPtr.Zero;
String dir = @"\Program Files" + @"\" + "mobileProg"+@"\";
see.lpDirectory = dir;
see.lpIDList = IntPtr.Zero;
see.lpParameters = IntPtr.Zero;
see.lpVerb = IntPtr.Zero;
see.nShow = 0;
see.lpFile = pData;

            try
            {
                ShellExecuteEx(see);
            }
            catch (Exception ex)
            {

            }

            LocalFree(pData);


nun zu meinen Problem:

wenn ich dieses update laufen lasse erscheint die Meldung ob das update installiert werden soll. Damit kann ich noch leben aber danach kommt die Auswahl des Installationsverzeichnisses. Und das muss ich definitv unterbinden können.

Kann ich beim erstellen der update.cab irgendwelche Parameter noch einstellen[VS2008] das er automatisch ein vorgegebenes Verzeichnis übernimmt ? Oder mache ich beim Aufruf des updates einen Fehler?

Moderiert von user profile iconKha: Code- durch C#-Tags ersetzt
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 09.06.09 01:51 
Welches Programm zeigt die Meldung denn an? Also wie läuft das Update überhaupt? :gruebel:
Raorkon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 86
Erhaltene Danke: 1



BeitragVerfasst: Di 09.06.09 09:35 
Die Installationsroutine des updates zeigt diese Meldung an.

Ich habe nun als Lösung (auch wenn Sie meiner Meinung nach nicht schön ist) das kompilieren Hauptprogramm übertragen, kopiere diese dann in das entsprechende Verzeichnis und starte Windows CE neu (Das Hauptprogramm ist in die Autostart eingetragen).