FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Blackbox Inno Setup Script (https://fileforums.com/showthread.php?t=94425)

y_thelastknight 05-05-2013 04:10

Quote:

Originally Posted by adiga (Post 417846)
1-i wanna make 2 dvd's
setup-1.bin in dvd1
and setup-2.bin in dvd2
how can i edit that in script !!

find this line and
Code:

if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup-1.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
change like this
Code:

if not ISArcExtract ( 0, 50, ExpandConstant('{src}\setup-1.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ShowChangeDiskWindow ('Please Insert Next Disk To Continue..', ExpandConstant('{src}'),'Setup-2.bin') then break;
if not ISArcExtract ( 0, 50, ExpandConstant('{src}\setup-2.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;

Quote:

2- how can i make logo.bmp Button in setup
when i click for logo open my website ^__^
in the script find this line
Code:

procedure InitializeWizard1();
and add this script under InitializeWizard1()
Code:

WizardForm.WizardBitmapImage2.Cursor:=crHand;
WizardForm.WizardBitmapImage2.OnClick:=@LogoLabelOnClick;

and add this script above InitializeWizard1()
Code:

procedure LogoLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
  begin
  ShellExec('open', 'https://www.google.lk/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
end;

its should be like this
Code:

procedure LogoLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
  begin
  ShellExec('open', 'https://www.google.lk/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
end;

procedure InitializeWizard1();
begin
  WizardForm.WizardBitmapImage2.Cursor:=crHand;
  WizardForm.WizardBitmapImage2.OnClick:=@LogoLabelOnClick;


sidelee72 05-05-2013 06:03

problem solved!

Igor007 17-05-2013 16:12

Hi. How to edit where the main game exe is located, because it's in Bin32 folder, not in main game folder, so desktop shortcut is not working?

Kurutucu 17-05-2013 16:25

You can edit in Main.iss . Change Kurutucu.exe to your game exe and directory.

Shanilka 19-05-2013 01:20

Plz Help Me Guys
 
How to add Compact View Option to my setup :cool:

PinHeaDi 20-05-2013 03:08

Can i use The Inno comprison ? With Freearc it show me errors every time, or can anyone explain for noobs like me ;(

Kurutucu 20-05-2013 07:44

@Shanilka

I don't know. Sorry :(

@PinHeaDi

With inno compression giving errors. This Freearc, 7zip, Rar etc. only.

PinHeaDi 20-05-2013 08:46

Ok. I finally figured it, my other qeustion is there a way to maker only .exe file. I mean all the file to be in one exe file and not in a .bin

Razor12911 20-05-2013 09:40

Instructions on blackbox script

Ok, First things first.

This blackbox script/installer doesn't support internal compression therefore, I will show you how to use the freearc, 7zip, srep, precomp, winrar, diskchange unpacking.

Now here is an example and a few explainations.

if not ISArcExtract (Component, Progress, ArchiveSource, Destination, '', false, Password, ExpandConstant('{tmp}\arc.ini'), True/False) then break;

if not IS7ZipExtract (Component, Progress, ArchiveSource, Destination, True/False, Password) then break;

if not ISRarExtract (Component, Progress, ArchiveSource, Destination, True/False, Password) then break;

if not ISSRepExtract (Component, Progress, ArchiveSource, Destination, True/False) then break;

if not ISPrecompExtract(Component, Progress, ArchiveSource, Destination, True/False) then break;

e.g.

if not ISArcExtract ( 0, 100, ExpandConstant('{src}\Data1.bin'), ExpandConstant('{app}\'), '', false, '1234', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), False) then break;

Component > Allows unpacking when the component is selected. Ask for more info about this.

e.g

if not ISArcExtract ( 0, 100, ExpandConstant('{src}\Data1.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), False) then break;

Progress > The progressbar taken up by the unpacking progress of archive. Take NOTE, 100 is the total, therefore is it's one archive, set 100, if two, set 50 and the other 50

if not ISArcExtract ( 0, 50, ExpandConstant('{src}\Data1.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), False) then break;

if not ISArcExtract ( 0, 50, ExpandConstant('{src}\Data2.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), False) then break;

ArchiveSource > Now as you can see, the example, ExpandConstant('{src}\Data1.bin'). The expandconstant is for the constant expansion for never mind it but you should take it for granted. {src} which means source of the setup, {pf} means the folder program files, for other constants, click here.

e.g.

if not ISArcExtract ( 0, 100, ExpandConstant('{src}\Data1.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), False) then break;

Destination > it acts the same way as the source of files but now you are directing the files in the archive to be unpacked in a folder, take note, this can only work if you are unpacking freearc, 7z or rar archive because they can contain a lot of files in one and as for precomp and srep, specify the destination file.

e.g.

if not ISArcExtract ( 0, 100, ExpandConstant('{src}\Data1.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;

if not ISPrecompExtract( 0, 0, ExpandConstant('{src}\data.pcf'), ExpandConstant('{app}\data.arc'), true) then break;

Password > The archive password set by you.

e.g.

if not ISArcExtract ( 0, 100, ExpandConstant('{src}\Data1.bin'), ExpandConstant('{app}\'), '', false, '1234', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), False) then break;

True/False > aka. notPCFonFLY {PCFonFLY} It's an option to delete file after unpacking process, True means, file must be deleted and False means file mustn't be deleted.

e.g.

if not ISArcExtract ( 0, 100, ExpandConstant('{src}\Data1.bin'), ExpandConstant('{app}\'), '', false, '1234', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), False) then break;

Now, here are a few examples.

The Password feature is only available for 7z, rar and arc.

Freearc

if not ISArcExtract ( 0, 100, ExpandConstant('{src}\Data1.bin'), ExpandConstant('{app}\'), '', false, '1234', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), False) then break;

7zip

if not IS7ZipExtract ( 0, 75, ExpandConstant('{src}\data1.7z'), ExpandConstant('{app}'), false, '1234') then break;

rar

if not ISRarExtract ( 0, 25, ExpandConstant('{src}\data.rar'), ExpandConstant('{app}'), false, '4321') then break;

srep

if not ISSRepExtract ( 0, 10, ExpandConstant('{app}\data.srep'),ExpandConstant(' {app}\data.pcf'), true) then break;

precomp

if not ISPrecompExtract( 0, 90, ExpandConstant('{app}\data.pcf'), ExpandConstant('{app}\data.arc'), true) then break;


Now comes to the diskchange

if not ShowChangeDiskWindow (Text, ExpandConstant('{src}'),Archive) then break;

Text > The text which should be written to notify the user of the setup on what to do.

Archive > The archive the setup can use for verification.

e.g.

if not ShowChangeDiskWindow ('Insert the next disk...', ExpandConstant('{src}'),'Data7.cab') then break;

skakmatch 20-05-2013 12:38

Thanks for blackbox inno setup script

Default installation folder
PHP Code:

C:\Program Files\Name of Game 

how to change default script to Publisher folder
PHP Code:

C:\Program Files\Publisher\Name Of Game 

Ex :
PHP Code:

C:\Program Files\UbiSoft\FarCry 3 


Kurutucu 20-05-2013 12:47

@skakmatch

Open Main.iss.

1. Add this under #defines:

Code:

#define Publisher "Ubisoft"
2. Find DefaultDirName={{#Dir}}\{#AppName} then change with this

Code:

DefaultDirName={{#Dir}}\{#Publisher}\{#AppName}

Razor12911 20-05-2013 12:48

@skakmatch
{pf}\UbiSoft\FarCry 3

Quote:

Originally Posted by Shanilka (Post 418237)
How to add Compact View Option to my setup :cool:

[Types]
Name: full; Description: Full installation; Flags: iscustom

D4rkSp4wn 21-05-2013 04:20

Hi, iam compressing my game with -mprecomp+srep+lzma:a1:mfbt4:d256m:fb128:mc1000:lc8

using Freearc 0.67 alpha, i have included the arc.ini in the script and theres only one file called Data-1.bin

The decompressionj line is
Code:

if not ISArcExtract ( 0, 100, ExpandConstant('{src}\Data-1.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
all seems to be normal but when it starts the extraction i got the following errors

http://imageshack.us/a/img819/3221/error1i.png

when i press ok i get

http://img199.imageshack.us/img199/7880/error2g.png

i am kinda stuck, any help will be much appreciated.

Razor12911 21-05-2013 04:32

1 Attachment(s)
@D4rksp4wn

Use this unarc.dll

download and extract attachment, copy and replace the unarc.dll in include folder

D4rkSp4wn 21-05-2013 13:20

Quote:

Originally Posted by Razor12911 (Post 418325)
@D4rksp4wn

Use this unarc.dll

download and extract attachment, copy and replace the unarc.dll in include folder

Thank you very much for the fast reply but unfortunately it didnt worked for me, i am still getting the same error.

Thank you in advance.

Razor12911 21-05-2013 13:26

by the way. What method did you use?

y_thelastknight 21-05-2013 13:39

i think its precomp error..try without precomp..

D4rkSp4wn 21-05-2013 16:47

Quote:

Originally Posted by Razor12911 (Post 418347)
by the way. What method did you use?


The compression method i used is
Code:

-mprecomp+srep+lzma:a1:mfbt4:d256m:fb128:mc1000:lc8
i have also tried copying the unarc.exe and arc.exe from my Freearc bin folder to the include folder but unfortunately it did not helped.

they way i am doing it is:

i browse the main game folder, select all files and folders by pressing Alt+A then right clicking it and cascade menu Freearc===> Add to Archive

during the compression process i have noticed that the precomp version used by Freearc is the 0.42 so i have defined it in the decompression script header as 0.42.

Weird thing is that if i extract the file using the right click options==>Freearc==>Extract Here all works fine and the file get extracted with no error.

Also noticed that selecting all files and folders and using the -m0 then srep (default settings) then Freearc -mx works if i define the decompression lines in the script but the compression ratio is not good as if i use the
Code:

-mprecomp+srep+lzma:a1:mfbt4:d256m:fb128:mc1000:lc8
compression chain.

Also if i use the precomp(default settings) before srep compressing manually it seems srep cant do anything with the precomp file so looks like doing it manually is not an option for me.

i am used to scripting but this one is really cracking my head with this error, i have been compressing games since 2001 and i have experience with a lot of compression algorithms (like darkcomp paq*,uha etc) i still use the setup.bat thingy but since it can get some users in trouble because of windows user permissions and UAC and bla bla bla i am moving to Inno and the best stuff i got till now is this script (Faster,Easier etc.).

Anyway, the game i am doing final size is 15gb and compressed i got it to 2.12gb using audio conversion and file injection so i am happy with the size itself hehe, i just need to get rid of this damn error lol.

Best Regards

Zocky 22-05-2013 05:09

Problem Decompress :confused:

Code:

if not ISArcExtract ( 0, 50, ExpandConstant('{src}\Setup-1.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISSRepExtract ( 0, 10, ExpandConstant('{app}\Setup-1.srep'),ExpandConstant(' {app}\Setup-1.pcf'), true) then break;
if not ISPrecompExtract( 0, 90, ExpandConstant('{app}\Setup-1.pcf'), ExpandConstant('{app}\Setup-1.bin'), true) then break;
if not ISArcExtract ( 0, 50, ExpandConstant('{src}\Setup-1.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISArcExtract ( 0, 50, ExpandConstant('{src}\Setup-2.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISSRepExtract ( 0, 10, ExpandConstant('{app}\Setup-2.srep'),ExpandConstant(' {app}\Setup-2.pcf'), true) then break;
if not ISPrecompExtract( 0, 90, ExpandConstant('{app}\Setup-2.pcf'), ExpandConstant('{app}\Setup-2.bin'), true) then break;
if not ISArcExtract ( 0, 50, ExpandConstant('{src}\Setup-2.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISArcExtract ( 0, 50, ExpandConstant('{src}\Setup-3.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISSRepExtract ( 0, 10, ExpandConstant('{app}\Setup-3.srep'),ExpandConstant(' {app}\Setup-3.pcf'), true) then break;
if not ISPrecompExtract( 0, 90, ExpandConstant('{app}\Setup-3.pcf'), ExpandConstant('{app}\Setup-3.bin'), true) then break;
if not ISArcExtract ( 0, 50, ExpandConstant('{src}\Setup-3.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;


Razor12911 22-05-2013 07:16

@D4rkSp4wn

i see, this script has a lot of bugs which i can fix and make them disappear but my hands are tied.

Try that method using the converter, program i created. If it fails, then there's nothing i can do.

Razor12911 22-05-2013 07:19

@Zocky,

first error is the progress, read up the tutorials i did on the previous page.

D4rkSp4wn 22-05-2013 07:28

Quote:

Originally Posted by Razor12911 (Post 418384)
@D4rkSp4wn

i see, this script has a lot of bugs which i can fix and make them disappear but my hands are tied.

Try that method using the converter, program i created. If it fails, then there's nothing i can do.

what converter? can you please link me to it?

Razor12911 22-05-2013 09:43

fileforums.com/showthread.php?t=94435 there. And almost forgot, the problem might be arc.ini too.

D4rkSp4wn 22-05-2013 14:45

thank you very much, downloading and testing your code right now, once tested will let you know my thoughts.

all the best from Brazil.

foo8088 23-05-2013 00:46

ops sry i found the answer

D4rkSp4wn 24-05-2013 07:53

Quote:

Originally Posted by foo8088 (Post 418424)
ops sry i found the answer

Could you please share it with us?

Kurutucu 25-05-2013 15:44

Updated 1.4

-Added Publisher.

-Fixed all extraction problems and bugs.

goku1205 26-05-2013 09:14

Is not work :/ Problem in ISDone

Razor12911 26-05-2013 09:49

Instructions

D4rkSp4wn 26-05-2013 10:29

i still have the same problem extracting precomp+srep+freearc

Razor12911 26-05-2013 10:35

ok wait... uploading v1.4 update for unicode :D

D4rkSpa4wn will fix the bug just wait a few minutes

y_thelastknight 26-05-2013 10:56

Quote:

Originally Posted by D4rkSp4wn (Post 418632)
i still have the same problem extracting precomp+srep+freearc

dude can you post your compressing file like arc.ini compress.bat precomp.exe srep.exe

D4rkSp4wn 26-05-2013 11:16

Using freearc 0.67

i select the all content of the main game folder, right click it, freearc add to archive

in the compression method in the gui i use

Code:

-mprecomp+srep+lzma:a1:mfbt4:d256m:fb128:mc1000:lc8
my arc.ini for decompression is


[External compressor:srep]
;options = l%d (minimal match length, default=512)
header = 0
packcmd = srep {options} -m3f $$arcdatafile$$.tmp $$arcpackedfile$$.tmp
unpackcmd = srep -d -s $$arcpackedfile$$.tmp $$arcdatafile$$.tmp

[External compressor:precomp]
header = 0
packcmd = precomp -intense0 -c- {options} -o$$arcpackedfile$$.tmp $$arcdatafile$$.tmp
unpackcmd = precomp -o$$arcdatafile$$.tmp -r $$arcpackedfile$$.tmp

decompression line in the script is

Code:

    if not ISArcExtract ( 0, 100, ExpandConstant('{src}\*.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
the errors i get are:

http://imageshack.us/a/img819/3221/error1i.png

when i press ok i get

http://img199.imageshack.us/img199/7880/error2g.png

i have included the arc.ini into the script with the line

Code:

Source: Include\arc.ini; DestDir: {tmp}; Flags: dontcopy
i have no idea about what i am doing wrong lol

y_thelastknight 26-05-2013 11:25

Quote:

Originally Posted by D4rkSp4wn (Post 418637)
Using freearc 0.67

i select the all content of the main game folder, right click it, freearc add to archive

in the compression method in the gui i use

Code:

-mprecomp+srep+lzma:a1:mfbt4:d256m:fb128:mc1000:lc8
my arc.ini for decompression is


[External compressor:srep]
;options = l%d (minimal match length, default=512)
header = 0
packcmd = srep {options} -m3f $$arcdatafile$$.tmp $$arcpackedfile$$.tmp
unpackcmd = srep -d -s $$arcpackedfile$$.tmp $$arcdatafile$$.tmp

[External compressor:precomp]
header = 0
packcmd = precomp -intense0 -c- {options} -o$$arcpackedfile$$.tmp $$arcdatafile$$.tmp
unpackcmd = precomp -o$$arcdatafile$$.tmp -r $$arcpackedfile$$.tmp

decompression line in the script is

Code:

    if not ISArcExtract ( 0, 100, ExpandConstant('{src}\*.bin'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
the errors i get are:

http://imageshack.us/a/img819/3221/error1i.png

when i press ok i get

http://img199.imageshack.us/img199/7880/error2g.png

i have included the arc.ini into the script with the line

Code:

Source: Include\arc.ini; DestDir: {tmp}; Flags: dontcopy
i have no idea about what i am doing wrong lol

what is ur precomp and srep version?

Razor12911 26-05-2013 11:28

1 Attachment(s)
BlackBox Inno Setup Script Unicode

Update v1.4

Changes
-Fixed Splash Screen
-Fixed Bug in data unpacking
-Added Srepx64 and Lzmax64 Support
-Now Set up archives in archive.ini
-Freearc 0.67 Alpha Support added

D4rkSp4wn 26-05-2013 11:35

Quote:

Originally Posted by y_thelastknight (Post 418638)
what is ur precomp and srep version?

precomp 043
srep 3.2

both copied to include folder

i had no luck with precomp 042

and the older srep versions

Razor12911 26-05-2013 11:39

use precomp 038-042
use any srep version

I used this method in v1.4 Unicode Script and it worked

-mprecomp:t-jnf:zl31,34,39,44,55,64,67,68,73,74,75,84,85,94,97 ,99:d0+srep64+delta+lzma64:a1:mfbt4:d158m:fb273:mc 1000:lc8

D4rkSp4wn 26-05-2013 12:42

looks like the ansi version is messed up, unicode version working fine here, even with precomp043 (If you change it on arc.ini and include it on the precompinside folder)

Razor12911 26-05-2013 12:49

hmm, I didn't even know that precomp043 is supported in isdone, will add support to my source.

D4rkSp4wn 26-05-2013 13:35

Found the solution for my problem with the ansi version.

Open the arc.ini and find the line:
Code:

unpackcmd = srep -d -s $$arcpackedfile$$.tmp $$arcdatafile$$.tmp
Change to:
Code:

unpackcmd = srep {options} -d -s - - <stdin> <stdout>
all working fine now.


All times are GMT -7. The time now is 12:30.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com