Jump to content
Korean Random
EvilAlex

Создание инсталляторов для модпаков на базе Inno Setup

Recommended Posts

4 часа назад, BeJIuKuu_TaHKoBbIu_BouH сказал:

Прочитай всю тему и они появятся.

умрешь пока все перечитаешь 

  • Downvote 2

Share this post


Link to post

Short link
Share on other sites

 Добро всем, подскажите кто нибудь вот такой скрипт, при выборе чекбокса чтоб появлялось привязанное к нему системное окно с (да, нет) и с описанием

Новый точечный рисунок.bmp

Edited by Сергей 2010

Share this post


Link to post

Short link
Share on other sites
5 часов назад, night_dragon_on сказал:

@Сергей 2010 , это не системное окно, это обычный MsgBox

ну а есть скриптик поделится в личку можешь если не жалко

Share this post


Link to post

Short link
Share on other sites

День добрый. Полазил по теме и не нашел. У меня часть модов загружается с фтп и соответственно они после удаление через штатный unins остаются в папке. Можно как-то их прописать туда, чтобы они удалялись?

 

И еще как бороться с ошибкой неизвестного класса TItemArea при использовании АНСИ?

Share this post


Link to post

Short link
Share on other sites
3 hours ago, Furious said:

У меня часть модов загружается с фтп и соответственно они после удаление через штатный unins остаются в папке. Можно как-то их прописать туда, чтобы они удалялись?

Ищите в справке секцию "UninstallDelete".

 

3 hours ago, Furious said:

И еще как бороться с ошибкой неизвестного класса TItemArea при использовании АНСИ?

Использовать версию IS от restools.

  • Upvote 2

Share this post


Link to post

Short link
Share on other sites
В 18.06.2018 в 15:42, Kotyarko_O сказал:

Использовать версию IS от restools.

Вроде бы все работает и компилится, но появилась новая напасть при подкачке файлов. По какой это может быть причине?

 

снимок.PNG

Share this post


Link to post

Short link
Share on other sites
3 hours ago, Furious said:

По какой это может быть причине?

Без кода не получится сказать что-то внятное. Как минимум, стоит проверить, правильная ли причина указана в окне ошибки.

  • Upvote 2

Share this post


Link to post

Short link
Share on other sites

Hi All, 

Я дважды читал эту тему.
Есть ли какой-нибудь пример, показывающий, как добавлять ссылки для некоторых конкретных компонентов, которые позволяют нам посещать сайт модератора?

 

(Sorry for using Google translation!)
I've read this thread twice.
Is there any example for showing how to add links for some specific components which allow us to visit modder's site?

ZHx2LI9.jpg

Share this post


Link to post

Short link
Share on other sites
1 hour ago, hakabase said:

Is there any example for showing how to add links for some specific components which allow us to visit modder's site?

No. But there`s nothing difficult.

Same as items descriptions, you have to create regular label (for example), which will change self caption according to focused item. And set "OnClick"-event for this label - for links executing.

Edited by Kotyarko_O

Share this post


Link to post

Short link
Share on other sites
7 часов назад, Kotyarko_O сказал:

No. But there`s nothing difficult.

Same as items descriptions, you have to create regular label (for example), which will change self caption according to focused item. And set "OnClick"-event for this label - for links executing.


Thanks for the tip, I'll figure it out.
Also wanna thank you for your source code which help me a lot. 

Share this post


Link to post

Short link
Share on other sites

Hi All,

It's me again,

I figure out a method that allows user to link to different author's page, not perfectly but works.

Here is my code:

[code]

var
  AuthorURL :TNewStaticText;

procedure AuthorURLClick(Sender: TObject);
var
  ErrorCode:integer;

begin

 if WizardForm.ComponentsList.Selected[3] then 
 begin
  ShellExec('open','http://www.facebook.com','','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
 end;

 if WizardForm.ComponentsList.Selected[4] then 
 begin 
  ShellExec('open','http://www.blogspot.com','','',SW_SHOWNORMAL,ewNoWait,ErrorCode); 
 end;

end;

procedure InitializeWizard();

begin

  AuthorURL:= TNewStaticText.Create(WizardForm);
  AuthorURL.Parent := WizardForm.SelectComponentsPage;
  AuthorURL.Top:=WizardForm.TYPESCOMBO.Top + ScaleY(160) ;
  AuthorURL.Left:=ScaleX(405);
  AuthorURL.Caption:='Visit Author';
  AuthorURL.AutoSize:=True;
  AuthorURL.Cursor:=crHand;
  AuthorURL.Font.Color:=clblue;
  AuthorURL.Font.Size:=9;
  AuthorURL.Font.Style := [fsBold];
  AuthorURL.OnClick:=@AuthorURLClick;

end;

 

 

My queston is : If I want the caption ' Visit Author ' invisible when user selects nothing or highlights an item without link. how should I do?

cmfrDe4.jpg
 

Edited by hakabase

Share this post


Link to post

Short link
Share on other sites
59 minutes ago, hakabase said:

My queston is : If I want the caption ' Visit Author ' invisible when user selects nothing or highlights an item without link. how should I do?

Try this: ItemURLLink.iss

To set a link to the item you have to register data, like this:

AddItemURLLink(x, 'y', 'z');

Where:

  • x - current CheckListBox (WizardForm.ComponentList or other custom TNewCheckListBox);
  • y - caption of the item you want to link with URL - z;
  • z - URL.
Edited by Kotyarko_O

Share this post


Link to post

Short link
Share on other sites
4 minutes ago, hakabase said:

It doesn't work for me. An error message pops up when I run the installer.

It seems you use some object before it creation.

Share this post


Link to post

Short link
Share on other sites

I've removed everything except your code in code section, but problem is still there. is it about compiler? I use standard version not the enhanced one.

 

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

#define MyAppName "{cm:MyAppName}"
#define MyModVersion "1.0.2.1"
#define MyAppVersion "1.0.2.1.01"
#define MyAppPublisher "模界特調"
#define MyAppURL "http://hakamod.blogspot.com/"

;--下載檔案 1 --;
#include <idp.iss> 


[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={{XX})
AppName={#MyAppName}
AppVersion={#MyModVersion}
;AppVerName={#MyAppName} {#MyModVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
UsePreviousAppDir=yes
;不會重複資料夾名稱
AppendDefaultDirName=no
DefaultDirName=\games\World_of_Tanks
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
;LicenseFile=
InfoBeforeFile=thanksto.txt
InfoAfterFile=thanksto.txt
LicenseFile=License.rtf
OutputDir=D:\hakaMOD-TEST
OutputBaseFilename=hakaMOD_WOT_{#MyModVersion}_trial
Compression=lzma
SolidCompression=yes
WizardImageFile=hakaMOD-1.bmp
WizardSmallImageFile=hakaMOD-2.bmp
;不讓圖變形,對整個介面也有影響
;WizardImageStretch=no
;產生反安裝檔
Uninstallable =yes
;不會詢問資料夾是否已存在
DirExistsWarning=no
;再次安裝時,依然會秀出安裝位置選擇框
DisableDirPage=no
DisableWelcomePage=no
SetupIconFile=hakaMOD.ico
SetupLogging=yes


[Languages]

Name: "en"; MessagesFile: "compiler:\Default.isl" ;InfoBeforeFile: "thanksto.txt"; InfoAfterFile: "thanksto.txt"; LicenseFile:"License-en.rtf"
Name: "tw"; MessagesFile: "compiler:Languages\ChineseTraditional.isl" ;InfoBeforeFile: "thanksto.txt"; InfoAfterFile: "thanksto.txt"; LicenseFile:"License.rtf"
Name: "jp"; MessagesFile: "compiler:Languages\Japanese.isl" ;InfoBeforeFile: "thanksto.txt"; InfoAfterFile: "thanksto.txt"; LicenseFile:"License.rtf"


                    

[Dirs]
Name: "{app}\hakaBKUP"


[Code]



//---作者連結 1 開始---\\

Type
 TItemURL = record
  CLBHWND: Longint;
  ItemCaption: String;
  URL: String;
 end;

Var
 ItemsURL: Array of TItemURL;
 URLSText: TNewStaticText;

Procedure URLSTextOnClick(Sender: TObject);
var
 ErrCode: Integer;
begin
 ShellExec('', TNewStaticText(Sender).Hint, '', '', SW_HIDE, ewNoWait, ErrCode);
end;

Procedure CheckListBoxOnClick_ShowItemURL(Sender: TObject);
var
 I: Integer;
begin
 URLSText.Hide();

 with TNewCheckListBox(Sender) do
  for I := 0 to GetArrayLength(ItemsURL) - 1 do
   if Handle = ItemsURL[I].CLBHWND then
    if Selected[Items.IndexOf(ItemsURL[I].ItemCaption)] then
    begin
     URLSText.Show();
     URLSText.Hint := ItemsURL[I].URL;
    end;
end;

Procedure AddItemURLLink(ACheckListBox: TNewCheckListBox; const AItemCaption, AURL: String);
var
 Idx: Integer;
begin
 Idx := GetArrayLength(ItemsURL);
 SetArrayLength(ItemsURL, Idx + 1);

 ACheckListBox.OnClick := @CheckListBoxOnClick_ShowItemURL;

 with ItemsURL[Idx] do
 begin
  CLBHWND := ACheckListBox.Handle;
  ItemCaption := AItemCaption;
  URL := AURL;
 end;
end;


//---作者連結 1 結束---\\



  

procedure InitializeWizard();



begin




  
//--點擊元件可以顯示說明圖例結束 B--\\


//---作者連結 2 開始---\\

URLSText := TNewStaticText.Create(WizardForm);
 with URLSText do
 begin
  Parent := WizardForm.SelectComponentsPage;
  SetBounds(ScaleX(405), WizardForm.TYPESCOMBO.Top + ScaleY(160), 0, 0);
  Caption := 'Visit Author';
  AutoSize := True;
  WordWrap := False;
  Cursor := crHand;
  Font.Color := clblue;
  Font.Size := 9;
  Font.Style := [fsBold];
  OnClick := @URLSTextOnClick;
  Hide();
 end;

 AddItemURLLink(3, 'A', 'www.google.com');
 AddItemURLLink(4, 'B', 'www.facebook.com');

//---作者連結 2 結束---\\


end;




[Types]
Name: "full"; Description: "{cm:type_full}"
Name: "compact"; Description: "{cm:type_compact}"
Name: "one"; Description: "{cm:type_one}"
Name: "custom"; Description: "{cm:type_custom}"; Flags: iscustom
Name: "test"; Description: "{cm:type_test}"


[Tasks]

Name: clean; Description: "{cm:task_clean}"; Flags: exclusive
Name: keep; Description: "{cm:task_keep}"; Flags: exclusive unchecked checkedonce
Name: del; Description: "{cm:task_del}"; Flags: unchecked checkedonce

[Components]

Name: "tools"; Description: "{cm:tools}"; Types: full compact test; Flags: disablenouninstallwarning
Name: "tools\mymod"; Description: "{cm:tools_mymod}"; Flags: disablenouninstallwarning

Name: "test"; Description: "{cm:test}"; Flags: disablenouninstallwarning
Name: "test\1"; Description: "{cm:test_1}"; Flags: disablenouninstallwarning
Name: "test\2"; Description: "{cm:test_2}"; Flags: disablenouninstallwarning



[Run]

;DLC AuC
Filename: "{tmp}\7za.exe"; Parameters: "x -y -o""{app}\res_mods\{#MyModVersion}"" ""{tmp}\test1.7z"""; Flags: runhidden skipifdoesntexist nowait

Filename: "{tmp}\7za.exe"; Parameters: "x -y -o""{app}\res_mods\{#MyModVersion}"" ""{tmp}\test2.7z"""; Flags: runhidden skipifdoesntexist nowait




;清除殘檔
Filename: "{tmp}\CleanTEMP.bat"; Flags: runhidden skipifdoesntexist
Filename: "{app}\CleanORIG.bat"; Flags: runhidden skipifdoesntexist


[Files]
Source: "工具\readme.txt"; DestDir: "{app}\res_mods\{#MyModVersion}"; tasks: clean; Flags: recursesubdirs createallsubdirs uninsneveruninstall
Source: "工具\readme.txt"; DestDir: "{app}\mods\{#MyModVersion}"; tasks: clean; Flags: recursesubdirs createallsubdirs uninsneveruninstall


Source: "工具\7za.exe"; DestDir: "{tmp}"

Source: "工具\CleanTEMP.bat"; DestDir: "{tmp}"
Source: "工具\CleanORIG.bat"; DestDir: "{app}"; Flags: deleteafterinstall
Source: "工具\CleanBKUP.bat"; DestDir: "{app}"; Flags: deleteafterinstall

Source: "工具\7za.exe"; DestDir: "{app}\hakaBKUP"
Source: "工具\test.bat"; DestDir: "{app}\hakaBKUP"; Flags: deleteafterinstall
Source: "工具\Copy7zLOG.bat"; DestDir: "{app}\hakaBKUP"

;Source: "工具\descctrl.dll"; Flags: dontcopy
Source: "工具\InnoCallback.dll"; Flags: dontcopy
Source: "modify_en.txt"; DestDir: "{tmp}"; Flags: dontcopy
Source: "modify_tw.txt"; DestDir: "{tmp}"; Flags: dontcopy
Source: "modify_en.txt"; DestDir: "{tmp}"; DestName: "modify_jp.txt"; Flags: dontcopy
Source: "TheArtists.txt"; DestDir: "{tmp}"; Flags: dontcopy


Source: "{app}\hakaBKUP\DLC_TEST1.7z"; DestDir: "{tmp}"; DestName: "test1.7z"; Components: test\1; Flags: external recursesubdirs createallsubdirs skipifsourcedoesntexist ; ExternalSize: 123456789
Source: "{app}\hakaBKUP\DLC_TEST2.7z"; DestDir: "{tmp}"; DestName: "test2.7z"; Components: test\2; Flags: external recursesubdirs createallsubdirs skipifsourcedoesntexist

;加入說明圖片
Source: "IMG\image0.bmp"; Flags: dontcopy
Source: "IMG\image1.bmp"; Flags: dontcopy
Source: "IMG\image2.bmp"; Flags: dontcopy
Source: "IMG\image3.bmp"; Flags: dontcopy
Source: "IMG\image4.bmp"; Flags: dontcopy

[Messages]

tw.LicenseLabel3=
en.LicenseLabel3=
jp.LicenseLabel3=

[CustomMessages]

tw.MyAppName=模界特調_戰車世界_{#MyModVersion}_下載測試
jp.MyAppName=模界特調_戰車世界_{#MyModVersion}_下載測試
en.MyAppName=hakaMOD_WOT_{#MyModVersion}_下載測試

tw.wrong_folder=Oops! 選錯位置了喔!請選擇"戰艦世界"遊戲的安裝位置,再試一次。
jp.wrong_folder=Oops! Wrong folder! Please chose game installed folder, Try again.
en.wrong_folder=Oops! Wrong folder! Please chose game installed folder, Try again.


;Tasks
tw.task_clean=乾淨安裝 刪除已裝模組(推薦)
jp.task_clean=乾淨安裝 刪除已裝模組(推薦)
en.task_clean=Clean Install--Delete existing mods(Recommand)
tw.task_keep=進階安裝 保留已裝模組
jp.task_keep=進階安裝 保留已裝模組
en.task_keep=Advanced Install--Keep existing mods
tw.task_del=安裝前,刪除已下載DLC檔案(非必要)
jp.task_del=安裝前,刪除已下載DLC檔案(非必要)
en.task_del=Delete downloaded DLC files before install


tw.type_full=推薦安裝
jp.type_full=推薦安裝
en.type_full=Recommand Install
tw.type_compact=簡單安裝
jp.type_compact=簡單安裝
en.type_compact=Simple install
tw.type_one=單選安裝
jp.type_one=單選安裝
en.type_one=Chose One by One
tw.type_custom=自選安裝
jp.type_custom=自選安裝
en.type_custom=Custom install
tw.type_test=模界測試
jp.type_test=模界測試
en.type_test=For Tester



;Components
tw.tools=------hakaMOD Tools / 模組安裝工具------
jp.tools=------hakaMOD Tools / 模組安裝工具------
en.tools=-------------hakaMOD Tools------------
tw.tools_mymod=安裝 自備模組
jp.tools_mymod=安裝 自備模組
en.tools_mymod=Install Player's Own Mods

tw.test=---------test / 下載測試--------
jp.test=---------test / 下載測試--------
en.test=---------test--------
tw.test_1=測試 1號
jp.test_1=測試 1號
en.test_1=test 1
tw.test_2=測試 2號
jp.test_2=測試 2號
en.test_2=test 2







 

Edited by hakabase

Share this post


Link to post

Short link
Share on other sites

@hakabase, you made a mistake in AddItemURLLink-procedure. First argument must be a CheckListBox, which contains your component with URL. And a second argument - name of your component.

So, you have to change this:

 AddItemURLLink(3, 'A', 'www.google.com');
 AddItemURLLink(4, 'B', 'www.facebook.com');

On this:

 AddItemURLLink(WizardForm.ComponentsList, CustomMessage('test_1'), 'www.google.com');
 AddItemURLLink(WizardForm.ComponentsList, CustomMessage('test_2'), 'www.facebook.com');

 

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...