Witam, piszę instalator w Inno Steup i mam pytanie.
Daje dyrektywe defined (5 nazw pliku exe + ikonki)
// EXE 1
#if ReadIni(SourcePath + "\Setup.ini", "Information", "AppEXE1", "") != ""
#define AppEXE1 ReadIni(SourcePath + "\Setup.ini", "Information", "AppEXE1", "")
// EXE 1 IKONKA
#define AppIconFile1 ReadIni(SourcePath + "\Setup.ini", "Information", "AppIconFile1", "")
#endif
// EXE 2
#if ReadIni(SourcePath + "\Setup.ini", "Information", "AppEXE2", "") != ""
#define AppEXE1 ReadIni(SourcePath + "\Setup.ini", "Information", "AppEXE2", "")
// EXE 2 IKONKA
#define AppIconFile2 ReadIni(SourcePath + "\Setup.ini", "Information", "AppIconFile2", "")
#endif
i tak 5 razy
Chce po instalacji stworzyc na pulpicie ikonki dla tych plikow (exe, najlepiej w pętli)
procedure CreateIcons();
var
i: Integer;
begin
{
function CreateShellLink (
const Filename,
Description,
ShortcutTo,
Parameters,
WorkingDir,
IconFilename: String;
const IconIndex,
ShowCmd: Integer
): String;
}
for i := 1 to 5 do begin
#ifdef AppEXE + str(i)
// Wyskakuje blad...
#endif
end;
jak zmodyfikowac kod zeby było poprawnie?, jezeli to w ogole mozliwe.
Wiem ze moge zrobic tak...
#ifdef AppEXE1
if IsTaskSelected('DesktopIcon1') then
CreateShellLink(
ExpandConstant('{commondesktop}\{#AppIconName1}.lnk'),
'',
ExpandConstant('{app}\{#AppExe1}'),
'',
ExpandConstant(ExtractFilePath('{app}\{#AppExe1}')),
ExpandConstant('{app}\{#AppFile1}'),
0,
SW_SHOWNORMAL
);
#endif
I tak 5 razy, a ja chce to dac w pętle.
reasumujac #ifdef AppEXE + str(i)
nie kompiluje
Jak to ugryś poprawnie, macie jakies pomysly?
Pozdrawiam.