Hi, ich hab ein Problem mit der Shortcut Dll, folgendes habe ich vor:
Also ich wollte mit dem GM ein Installationsprogramm programmieren, welches mit der Shortcut Dll und einer Exe (z.b. ein Spiel) in einem Ordner ist.
Das Programm soll dann dieses Spiel finden mit file_find_first, in einen Ordner kopieren und die Datei löschen und dann noch eine Verknüpfung auf dem Desktop erstellen.
Alles klappt soweit, bis auf den Error: unexpected error occured when running the game
Und es erstellt die Verknüpfung nicht auf dem Desktop sondern im Ordner, das hier ist der Code:
Alles anzeigen
Weiß jemand, warum dieser Error kommt, hat vllt schonmal jemand die Shortcut Dll verwendet?
Danke,
Gruß Gamer.
Also ich wollte mit dem GM ein Installationsprogramm programmieren, welches mit der Shortcut Dll und einer Exe (z.b. ein Spiel) in einem Ordner ist.
Das Programm soll dann dieses Spiel finden mit file_find_first, in einen Ordner kopieren und die Datei löschen und dann noch eine Verknüpfung auf dem Desktop erstellen.
Alles klappt soweit, bis auf den Error: unexpected error occured when running the game
Und es erstellt die Verknüpfung nicht auf dem Desktop sondern im Ordner, das hier ist der Code:
GML-Quellcode
- //scr_shortcut
- //Arguments - [3]
- //0 - .lnk path - path to the shortcut to be created including the filename
- //1 - .exe path - path to the executable to create a shortcut to
- //2- description - optional shortcut description, if not needed use ""
- //3- working directory - directory to run the exe in (you might need to include the final backslash )
- ///////////////////
- global.defTestDLL_CreateShortcut=external_define("Shortcut.dll","makeShortCut",dll_stdcall,ty_real,4,ty_string,ty_string,ty_string,ty_string);
- arg0=string_replace_all(argument0,"\","\\")
- arg1=string_replace_all(argument1,"\","\\")
- external_call(global.defTestDLL_CreateShortcut,arg0,arg1,argument2,argument3);
- external_free("Shortcut.dll")
GML-Quellcode
- //Create
- linkfile = file_find_first(working_directory + "\*.exe",0);
- speicherort = get_string("Where do you want to save your game?","C:\Programme\");
- if !directory_exists(speicherort)
- {directory_create(speicherort);}
- file_copy(linkfile,speicherort + linkfile);
- file_delete(linkfile);
- shortcut = string_copy(linkfile,1,string_pos(".",linkfile)-1);
- dll_shortcut(shortcut + ".lnk",speicherort + linkfile,"","Desktop\");
Weiß jemand, warum dieser Error kommt, hat vllt schonmal jemand die Shortcut Dll verwendet?
Danke,
Gruß Gamer.
Gruß Gamer