prog:inno_setup
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
prog:inno_setup [2017/06/27 22:51] – Correction des apostrophes root | prog:inno_setup [2022/02/11 21:56] (Version actuelle) – Mise à jour v6.2.0 root | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | [[http:// | + | [[http:// |
=====Modifier un fichier après installation===== | =====Modifier un fichier après installation===== | ||
Ligne 12: | Ligne 12: | ||
<code pascal> | <code pascal> | ||
procedure FileReplaceString(const FileName: string); | procedure FileReplaceString(const FileName: string); | ||
- | var | + | va |
MyFile : TStrings; | MyFile : TStrings; | ||
MyText : string; | MyText : string; | ||
Ligne 39: | Ligne 39: | ||
Root: HKLM; Subkey: " | Root: HKLM; Subkey: " | ||
</ | </ | ||
+ | |||
+ | =====Création d'un raccourci===== | ||
+ | [[https:// | ||
+ | |||
+ | <code pascal> | ||
+ | const | ||
+ | CLSID_ShellLink = ' | ||
+ | |||
+ | type | ||
+ | IShellLinkW = interface(IUnknown) | ||
+ | ' | ||
+ | procedure Dummy; | ||
+ | procedure Dummy2; | ||
+ | procedure Dummy3; | ||
+ | function GetDescription(pszName: | ||
+ | function SetDescription(pszName: | ||
+ | function GetWorkingDirectory(pszDir: | ||
+ | function SetWorkingDirectory(pszDir: | ||
+ | function GetArguments(pszArgs: | ||
+ | function SetArguments(pszArgs: | ||
+ | function GetHotkey(var pwHotkey: Word): HResult; | ||
+ | function SetHotkey(wHotkey: | ||
+ | function GetShowCmd(out piShowCmd: Integer): HResult; | ||
+ | function SetShowCmd(iShowCmd: | ||
+ | function GetIconLocation(pszIconPath: | ||
+ | out piIcon: Integer): HResult; | ||
+ | function SetIconLocation(pszIconPath: | ||
+ | function SetRelativePath(pszPathRel: | ||
+ | function Resolve(Wnd: | ||
+ | function SetPath(pszFile: | ||
+ | end; | ||
+ | |||
+ | IPersist = interface(IUnknown) | ||
+ | ' | ||
+ | function GetClassID(var classID: TGUID): HResult; | ||
+ | end; | ||
+ | |||
+ | IPersistFile = interface(IPersist) | ||
+ | ' | ||
+ | function IsDirty: HResult; | ||
+ | function Load(pszFileName: | ||
+ | function Save(pszFileName: | ||
+ | function SaveCompleted(pszFileName: | ||
+ | function GetCurFile(out pszFileName: | ||
+ | end; | ||
+ | |||
+ | procedure CreateShortCut(const FileName: string; const argument: string; const destination: | ||
+ | var | ||
+ | Obj: IUnknown; | ||
+ | SL: IShellLinkW; | ||
+ | PF: IPersistFile; | ||
+ | begin | ||
+ | if IsTaskSelected(' | ||
+ | begin | ||
+ | { Create the main ShellLink COM Automation object } | ||
+ | Obj := CreateComObject(StringToGuid(CLSID_ShellLink)); | ||
+ | |||
+ | { Set the shortcut properties } | ||
+ | SL := IShellLinkW(Obj); | ||
+ | OleCheck(SL.SetPath(ExpandConstant(' | ||
+ | OleCheck(SL.SetArguments(argument)); | ||
+ | OleCheck(SL.SetShowCmd(SW_SHOWNORMAL)); | ||
+ | |||
+ | { Save the shortcut } | ||
+ | PF := IPersistFile(Obj); | ||
+ | OleCheck(PF.Save(ExpandConstant(' | ||
+ | end; | ||
+ | end; | ||
+ | </ | ||
+ | |||
+ | Exemple d' | ||
+ | AfterInstall: |
prog/inno_setup.1498596676.txt.gz · Dernière modification : 2017/06/27 22:51 de root