0

I'm trying to run Inno Setup to automatically extract my SFX file without having to run extract manually. Is there any way? I leave my script below.

Is there also a way to make Inno Setup extract the SFX in the Myprogramfolder created by the installer?

I have compressed the SFX file using Winrar.

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Program2019"
#define MyAppVersion "1.0"
#define MyAppPublisher "Myappname."
#define MyAppURL "/"

[Setup]
WizardImageFile=C:\Users\Administrator\Desktop\Cover.bmp
; NOTE: The value of AppId uniquely identifies this application.
AppID={{31D336CF-0483-4A76-00000000000000000}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\Myprogram2019
DefaultGroupName={#MyAppName}
LicenseFile=C:\Users\Administrator\Desktop\Program2019\readme.txt
OutputDir=C:\Users\Administrator\Desktop\Program2019\Myprografolder
OutputBaseFilename=setup
SetupIconFile=C:\Users\Administrator\Desktop\Program2019\Myprogram\icon.ico
Compression=none
SolidCompression=true
InternalCompressLevel=Fast

[Languages]
Name: "english"; MessagesFile: "compiler:Languages\English.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

[Files]
Source: "C:\Program Files (x86)\Myprogramfolder\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\Administrator\Desktop\Program2019\Unpack\Evilpack.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
Source: "C:\Users\Administrator\Desktop\Program2019\languages\spanish\*"; DestDir: "{app}\game"; Languages: spanish; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Run]
Filename: "{tmp}\Evilpack.exe"; Parameters: "{tmp}\ZipFile.ZIP -d C:\TargetDir"

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Myprogram2019"; Filename: "{app}\mypro.exe";  IconFilename: {app}\icon.ico; \
  AfterInstall: SetElevationBit('{commondesktop}\Myprogram.lnk')

[Code]
{ RedesignWizardFormBegin } // Don't remove this line!
// Don't modify this section. It is generated automatically.
procedure RedesignWizardForm;
begin
{ ReservationBegin }
  // This part is for you. Add your specialized code here.

{ ReservationEnd }
end;

[Messages]
BeveledLabel=Myapp

enter image description here

EnmanuelGo
  • 47
  • 5
  • 3
    Have you had a look at the answer to this question? It sounds like it might help you. https://stackoverflow.com/questions/34923104/how-to-create-an-installer-using-inno-setup-which-extracts-the-contents-of-a-ra – Andrew Truckle Jan 06 '21 at 23:32
  • 3
    What does your script have to do with your question? Is the `Evilpack.exe` the SFX? Can you extract the SFX manually from commandline? What arguments do you use for that? – Martin Prikryl Jan 07 '21 at 07:44
  • I looked at the article but it didn't work, thanks a lot Andrew anyway :-) – EnmanuelGo Feb 22 '21 at 01:55
  • I wanted Inno to unpack the Evilpack.exe SFX files, thanks for Martin Prikryl – EnmanuelGo Feb 22 '21 at 01:57
  • So once again: Can you extract the SFX manually from commandline? What arguments do you use for that? – Martin Prikryl Feb 24 '21 at 07:30

1 Answers1

-1

Is very easy unpack in silent way SFX, setup to silent from the menu option ADVANCED, then SFX options in winrar. That is all!!

enter image description here

enter image description here

enter image description here

enter image description here

Finally

[Files]
Source: "C:\pathtofile\yoursfx.exe"; DestDir: "C:\Program Files\";Flags: ignoreversion
[Run]
Filename: "C:\Program Files\yoursfx.exe";  StatusMsg: "Your MSG"; Flags:  runascurrentuser


 [Code]
 procedure CurStepChanged(CurStep: TSetupStep);
 begin
 if CurStep = ssDone  then
  begin;

  DeleteFile(ExpandConstant('C:\Program Files\yoursfx.exe'));

   begin
  // user clicked Yes
  end;
  end;
  end;
     
MrBi
  • 308
  • 1
  • 14
  • Instead of `DeleteFile`, just extract the `yoursfx.exe` to `{tmp}` and run it from there. The Inno Setup will take care of deleting the file. And you can delete your whole `[Code]` section. + You have the path in `[Run]` wrong. It should match the `DestDir`, not `Source`. – Martin Prikryl Jan 05 '22 at 07:01