次のようなファイルパスの一部を置き換える StringChangeEx 関数の呼び出しに問題があります...
THIS: C:\Program Files (x86)\Steam\SteamApps\common\Stalker Call of Pripyat\bin
TO: C:\Program Files (x86)\Steam\SteamApps\common\Stalker Call of Pripyat_mm2\bin
元のファイル構造を維持しながら、ファイルを置き換える前にファイルをバックアップする方法として。
http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_stringchangeex
#define Name "Misery Mod"
#define Description "Misery Mod Installer"
#define Version "2.0"
#define Author "Misery Mod Development Team"
#define Website "http://miserymod.com"
#define Support "support@miserymod.com"
#define Copyright "Copyright [c] 2013 Misery Mod. All Rights Reserved."
#define Executable "Stalker-COP.exe"
[Setup]
AppId={{6423E48F-04F4-4E99-9420-FDD9165A6A90}
AppName={#Name}
AppVersion={#Version}
AppVerName={#Name} {#Version}
AppPublisher={#Author}
AppPublisherURL={#Website}
AppSupportURL={#Website}
AppUpdatesURL={#Website}
AppContact={#Support}
AppComments={#Description}
AppCopyright={#Copyright}
DefaultDirName={code:DetectIP}
DirExistsWarning=no
OutputDir=debug
OutputBaseFilename=mm2-installer
Compression=lzma2/ultra64
SolidCompression=yes
InternalCompressLevel=ultra
CompressionThreads=2
VersionInfoVersion={#Version}
VersionInfoCompany={#Author}
VersionInfoDescription={#Description}
VersionInfoTextVersion={#Name} {#Version}
VersionInfoCopyright={#Copyright}
VersionInfoProductName={#Name}
VersionInfoProductVersion={#Version}
VersionInfoProductTextVersion={#Name} {#Version}
DiskSpanning=True
DiskSliceSize=1566000000
SlicesPerDisk=1
MinVersion=0,5.01
SetupIconFile=mm2.ico
UninstallDisplayIcon={uninstallexe}
ShowTasksTreeLines=True
AlwaysShowGroupOnReadyPage=True
AlwaysShowDirOnReadyPage=True
LicenseFile=agreement.rtf
WizardImageFile=mm2-sidebar.bmp
WizardSmallImageFile=mm2-header.bmp
AllowCancelDuringInstall=False
DisableProgramGroupPage=yes
UninstallDisplayName={#Name}
InfoBeforeFile=C:\Users\Nathaniel\Desktop\MM2\readme.rtf
[Run]
Filename: {app}\{#Executable}; Description: {cm:LaunchProgram, {#Name}}; Flags: nowait postinstall skipifsilent unchecked
Filename: {#Website}; Description: {cm:VisitWebsite, {#Name}}; Flags: nowait shellexec postinstall skipifsilent unchecked
[CustomMessages]
LaunchProgram=Enter the Wasteland.
VisitWebsite=Visit {#Website}.
[Languages]
Name: "English"; MessagesFile: "compiler:Default.isl"
Name: "Ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
[Dirs]
Name: "{app}\_mm2"
[Files]
Source: "files\bin\*"; DestDir: {app}; Flags: ignoreversion createallsubdirs recursesubdirs; BeforeInstall: BackupFile
[Code]
var Base:String;
var Backup:String;
function DetectIP(Path:String): string;
var Steam:String;
var Retail:String;
Begin
const Base=ExpandConstant('{pf}')+'\'; // <- Identifier expected.
Steam:=ExpandConstant('{pf}')+'\Steam\SteamApps\common\Stalker Call of Pripyat';
Retail:=ExpandConstant('{pf}')+'\Steam\SteamApps\common\Stalker Call of Pripyat';
Begin
if DirExists(Steam) then
Base:=Steam;
End;
Begin
if DirExists(Retail) then
Base:=Retail;
End;
Result:=Base;
End;
procedure BackupFile();
var Folder:String;
var File:String;
Begin
Folder:=ExpandConstant(ExtractFilePath(CurrentFileName));
File:=ExpandConstant(CurrentFileName);
Backup:=StringChangeEx(Folder, Base, Base+'_mm2/', false);
MsgBox(Backup, mbInformation, MB_OK);
Begin
if not DirExists(Backup) then
CreateDir(Backup);
End;
End;
コンパイラ エラー!
行 89: 列 5: 識別子が必要です。