IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage Delphi Discussion :

Raccourci sur le bureau


Sujet :

Langage Delphi

  1. #1
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Août 2002
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Août 2002
    Messages : 3
    Points : 1
    Points
    1
    Par défaut Raccourci sur le bureau
    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)

  2. #2
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2002
    Messages
    2
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Avril 2002
    Messages : 2
    Points : 2
    Points
    2
    Par défaut
    Utilises InstallShield Express.

  3. #3
    Expert éminent
    Avatar de Lung
    Profil pro
    Analyste-programmeur
    Inscrit en
    Mai 2002
    Messages
    2 664
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Analyste-programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2002
    Messages : 2 664
    Points : 6 967
    Points
    6 967
    Par défaut
    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)

  4. #4
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juin 2002
    Messages
    10
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2002
    Messages : 10
    Points : 5
    Points
    5
    Par défaut
    héhé attention, c'est parti !
    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;
    et avec un exemple en plus, avec ceci ?
    Metzger, evidement !

  5. #5
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Août 2002
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Août 2002
    Messages : 3
    Points : 1
    Points
    1
    Par défaut
    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)

  6. #6
    Membre chevronné
    Avatar de Pierre Castelain
    Inscrit en
    Avril 2002
    Messages
    523
    Détails du profil
    Informations forums :
    Inscription : Avril 2002
    Messages : 523
    Points : 1 943
    Points
    1 943
    Par défaut
    Les lignes de metzger ne sont pas trop longues, c'est ton navigateur qui est trop étroit

  7. #7
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Août 2002
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Août 2002
    Messages : 3
    Points : 1
    Points
    1
    Par défaut
    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)

  8. #8
    Candidat au Club
    Profil pro
    Inscrit en
    Septembre 2002
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2002
    Messages : 4
    Points : 3
    Points
    3
    Par défaut
    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

Discussions similaires

  1. Réponses: 11
    Dernier message: 14/08/2006, 00h13
  2. application installant un raccourci sur le bureau
    Par ricotrutt dans le forum VB 6 et antérieur
    Réponses: 13
    Dernier message: 24/07/2006, 15h23
  3. raccourcis sur le bureau
    Par Galkir dans le forum C++Builder
    Réponses: 9
    Dernier message: 23/06/2006, 11h26
  4. Créer un raccourci sur le bureau
    Par NdmaX dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 13/04/2006, 17h21
  5. Raccourci sur le bureau
    Par AlDel dans le forum API, COM et SDKs
    Réponses: 2
    Dernier message: 07/03/2005, 17h07

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo