0

I am new to Stackoverlow and Inno Setup, well and to just about everything I guess.

I am trying to have Inno Setup search for a file (in this case Wow.exe(I am making an interface installer)) and then install folders and files into that directory.

For example:

  • User selects World of Warcraft Directory
  • Installer copies setup directories and files into World of Warcraft Folder

My problem:

#define MyAppName "Orangepaw3 UI Installer"
#define MyAppVersion "1.1"
#define MyAppPublisher "Orangepaw3.net"
#define MyAppURL "http://www.orangepaw3.net"
#define VCLStyle "RubyGraphite.vsf"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{56FE86A8-B8B8-42B6-A569-0D6D261AF486}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
InfoBeforeFile=C:\Users\user\files\instructions2.txt
InfoAfterFile=C:\Users\user\files\instructions.txt
OutputBaseFilename=OP3 UI Installer
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Code]

// Import the LoadVCLStyle function from VclStylesInno.DLL
procedure LoadVCLStyle(VClStyleFile: String); external 'LoadVCLStyleW@files:VclStylesInno.dll stdcall';

// Import the UnLoadVCLStyles function from VclStylesInno.DLL
procedure UnLoadVCLStyles; external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall';

function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('{#VCLStyle}');
LoadVCLStyle(ExpandConstant('{tmp}\{#VCLStyle}'));
Result := True;
end;

procedure DeinitializeSetup();
begin
    UnLoadVCLStyles;
end;

[Files]
Source: "D:\World of Warcraft\Interface\*"; DestDir: "{app}/Interface"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "D:\World of Warcraft\WTF\*"; DestDir: "{app}/WTF"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: VclStylesinno.dll; DestDir: {app}; Flags: dontcopy
Source: Styles\{#VCLStyle}; DestDir: {app}; Flags: dontcopy
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

Sorry if the above code is long, I did my best to format it correctly.

How can I change this so the installer finds Wow.exe on their system and then installs to that directory? World of Warcraft>Interface>Files and WTF>Files

I hope that makes sense. I have read all over the internet and am just confused at this point.

Thank you in advance.

Orangepaw3

Orangepaw3
  • 19
  • 7
  • So you want the installer to find the `wow.exe` instead of having the installer ask the user for "World of Warcraft Directory"? – Martin Prikryl Aug 28 '16 at 07:53
  • Correct, or any file really. This is mostly for educational purposes. I am very interested in this kind of thing. – Orangepaw3 Aug 29 '16 at 12:31
  • Start here: [How to search different file types using FindFirst?](http://stackoverflow.com/questions/5991040/how-to-search-different-file-types-using-findfirst) – Martin Prikryl Aug 29 '16 at 19:53
  • Though it's really a bad idea to search a whole system for a file. It can take tens of minutes. – Martin Prikryl Aug 29 '16 at 19:54

0 Answers0