Bonjour
j'aimerais avec les lignes de codes qui permettent de créer un raccourci sur le bureau lors d'une intallation d'1 prog.
Thanks
Bonjour
j'aimerais avec les lignes de codes qui permettent de créer un raccourci sur le bureau lors d'une intallation d'1 prog.
Thanks
(Système de V.V.V) Vivez Vos Vies (THE BAT)
Ou Inno setup.
Bien mieux.
L'urgent est fait, l'impossible est en cours, pour les miracles prévoir un délai. ___ Écrivez dans un français correct !!
C++Builder 5 - Delphi 6#2 Entreprise - Delphi 2007 Entreprise - Delphi 2010 Architecte - Delphi XE Entreprise - Delphi XE7 Entreprise - Delphi 10 Entreprise - Delphi 10.3.2 Entreprise - Delphi 10.4.2 Entreprise - Delphi 11.1 Entreprise
OpenGL 2.1 - Oracle 10g - Paradox - Interbase (XE) - PostgreSQL (15.4)
héhé attention, c'est parti !
et avec un exemple en plus, avec ceci ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120 uses Registry, ActiveX, ComObj, ShlObj; type ShortcutType = (_DESKTOP, _QUICKLAUNCH, _SENDTO, _STARTMENU, _OTHERFOLDER); function CreateShortcut(SourceFileName: string; // the file the shortcut points to Location: ShortcutType; // shortcut location SubFolder, // subfolder of location WorkingDir, // working directory property of the shortcut Parameters, Description: string): // description property of the shortcut string; const SHELL_FOLDERS_ROOT = 'Software\MicroSoft\Windows\CurrentVersion\Explorer'; QUICK_LAUNCH_ROOT = 'Software\MicroSoft\Windows\CurrentVersion\GrpConv'; var MyObject: IUnknown; MySLink: IShellLink; MyPFile: IPersistFile; Directory, LinkName: string; WFileName: WideString; Reg: TRegIniFile; begin MyObject := CreateComObject(CLSID_ShellLink); MySLink := MyObject as IShellLink; MyPFile := MyObject as IPersistFile; MySLink.SetPath(PChar(SourceFileName)); MySLink.SetArguments(PChar(Parameters)); MySLink.SetDescription(PChar(Description)); LinkName := ChangeFileExt(SourceFileName, '.lnk'); LinkName := ExtractFileName(LinkName); // Quicklauch if Location = _QUICKLAUNCH then begin Reg := TRegIniFile.Create(QUICK_LAUNCH_ROOT); try Directory := Reg.ReadString('MapGroups', 'Quick Launch', ''); finally Reg.Free; end; end else // Other locations begin Reg := TRegIniFile.Create(SHELL_FOLDERS_ROOT); try case Location of _OTHERFOLDER : Directory := SubFolder; _DESKTOP : Directory := Reg.ReadString('Shell Folders', 'Desktop', ''); _STARTMENU : Directory := Reg.ReadString('Shell Folders', 'Start Menu', ''); _SENDTO : Directory := Reg.ReadString('Shell Folders', 'SendTo', ''); end; finally Reg.Free; end; end; if Directory <> '' then begin if (SubFolder <> '') and (Location <> _OTHERFOLDER) then WFileName := Directory + '\' + SubFolder + '\' + LinkName else WFileName := Directory + '\' + LinkName; if WorkingDir = '' then MySLink.SetWorkingDirectory(PChar(ExtractFilePath(SourceFileName))) else MySLink.SetWorkingDirectory(PChar(WorkingDir)); MyPFile.Save(PWChar(WFileName), False); Result := WFileName; end; end; function GetProgramDir: string; var reg: TRegistry; begin reg := TRegistry.Create; try reg.RootKey := HKEY_CURRENT_USER; reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', False); Result := reg.ReadString('Programs'); reg.CloseKey; finally reg.Free; end; end; // Some examples: procedure TForm1.Button1Click(Sender: TObject); const PROGR = 'c:\YourProgram.exe'; var resPath: string; begin //Create a Shortcut in the Quckick launch toolbar CreateShortcut(PROGR, _QUICKLAUNCH, '','','','Description'); //Create a Shortcut on the Desktop CreateShortcut(PROGR, _DESKTOP, '','','','Description'); //Create a Shortcut in the Startmenu /"Programs"-Folder resPath := CreateShortcut(PROGR, _OTHERFOLDER, GetProgramDir,'','','Description'); if resPath <> '' then begin ShowMessage('Shortcut Successfully created in: ' + resPath); end; end;
Metzger, evidement !
Thanks a lot, je pense que je vais bien m'amuser avec ça. Mais tes lignes de code son trop longue
Merci qu'en même
The SENATEUR
(Système de V.V.V) Vivez Vos Vies (THE BAT)
Les lignes de metzger ne sont pas trop longues, c'est ton navigateur qui est trop étroit
mais tu vois, je voudrais bien que lorsque je vais installer mon programme que mes fichier se mettent automatiquement sur la partition que je voudrais bien. Lorsque je crée une table dans le accesdb il faut que je fasse un chemin statique dans le databasename puis le reste vous voyez. J'aimerais que ça tombe directement sur mon c ou d au lieux de définir sonchemin à chaque fois. (Lorsque je me deplace sur un autre pc avec mon travail j'ai ne sais plus travailler car le chemain n'est plus le même.
Merci encore
THE SENATEUR
(Système de V.V.V) Vivez Vos Vies (THE BAT)
Le meilleur installeur est a mon gout NSIS developpé par Nullsoft (les mecs qui font Winamp)
Une version française, avec un site francais existe ! a découvrir ici
http://www.winampfr.com/nsis
La syntaxe de programmation ressemble à du php rien de plus simple à comprendre
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager