Inno Setup experiences

Source: Internet
Author: User

I have studied inno setup for one day. The following describes my experiences. The basic knowledge of inno setup can be searched online.

I think it should be noted that:

[Setup]
(Click "tool> Generate GUID" in the compiler to generate a new GUID)
AppId = {33B09C83-AB05-47DE-BFC0-C13A85DA5743}
AppName = myprogram
AppVerName = myprogram
AppPublisher = your company name
AppPublisherURL = your company website
Appsuppurl url = your company website
AppUpdatesURL = your company website
DefaultDirName = {pf} \ myprogram <--------- in the installation wizard, the user is prompted to specify the default directory for installation.
; DefaultGroupName = myprogram <------ name of the Start Menu
OutputBaseFilename = myprogram <---------your Installation File Name Is myprogram.exe(if it is changed to setup, then the generated file name is setup.exe
Compression = none
SolidCompression = no
AlwaysRestart = no
; Do not specify the installation path or add a start menu item
; DisableDirPage = yes
Disableprogramgrouppage = Yes
Versioninfoversion = 0.1.1

[Ages]
Name: "Chinese"; messagesfile: "compiler: Default. isl" <------ specifies that the language used for installation is simplified Chinese.

; [Tasks]
Because it does not have a user interaction interface program and runs directly in the Command window, this driver cannot create shortcuts,
; Name: "desktopicon"; Description: "{CM: create‑topicon}"; groupdescription: "{CM: additionalicons}"; flags: unchecked

[Files] <-- Source: indicates the driver file on your computer. After compilation, it will be integrated into setup. When someone else uses this setup program, they directly put these files under the app directory of his computer. The app is the directory he chooses.
Source: "driver. inf"; destdir: "{app}"; flags: ignoreversion; check: isx86
Source: "driver. sys"; destdir: "{app}"; flags: ignoreversion; check: isx86
Source: "udriver.exe"; destdir: "{app}"; flags: ignoreversion; check: isx86
Source: "driver. IDS"; destdir: "{app}"; flags: ignoreversion; check: isx86
Source: "devcon.exe"; destdir: "{app}"; flags: ignoreversion; check: isx86
Source: "checkdriverexist. bat "; destdir:" {app} "; flags: ignoreversion; check: isx86 <--- this. bat is a self-written batch processing file, which is responsible for checking whether the current driver has been installed, to prevent multiple Installation

 
[Run] <------ The following is the installation of the hardware to be added.
Filename: "{app} \ devcon.exe"; parameters: "install us. INF "" Root \ usbipenum "; workingdir:" {app} "; flags: runhidden; check: issmiusboveripexist

[Code]
VaR
Errorcode: integer;
Resultstring: string;

Function isx86: Boolean;
Begin
Result: = Not iswin64;
End;

Function issmiusboveripexist: Boolean;
Begin
Shellexec ('', expandconstant ('{app} \ checkusboveripexist. bat '),
'','', Sw_hide, ewwaituntilterminated, errorcode );
Resultstring: = getinistring ('smiusboverip', 'result', resultstring, expandconstant ('{app} \ result. ini '));
Result: = true;
If (resultstring <> '0') then begin
Result: = false;
End
End;

I have never understood before. What are we going to do, and what are the steps for executing Inno serup? After thinking for a long time, I realized that the step-by-step interface has been ready for us. What we need to do is the files part and the run part.

Files is mainly used to add files to the user's system. You can perform conditional installation by checking in this process. It is mainly because the check function needs to be written by yourself.

With the previous part, compile the file, generate the EXE file, and install the file. However, the installation fails. I have never been able to figure out the actions for installation. Where? After reading other people's code, we can see that the Code is in the run section. The run part is the core. what we have been doing before is file transfer. Using devcon is the real hardware addition.

I am a bit ignorant. Maybe these things are very simple, and most people will not have such doubts. I hope that those who have such doubts will not take a long time like me to solve these simple problems.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.