Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 759
  • Last Modified:

How to use Inno setup compiler

I have downloaded and installed Inno ver.5.0.8 and am trying to make an installer for an app I wrote
I started a new project with it using the wizard and have added all the files I need to the project.

I need to:

Create 4 directories:
c:\dir
c:\dir\dir1
c:\dir\dir2
c:\dir\dir3

move 2 dll's to system 32 directory and register them

copy 3 files to c:\dir\dir1

then run one of the files copied (file.exe)

then force a reboot

I have no idea how to do this.  Can i write a function that does this stuff then tell inno to run this funciton during the installation or how else can I get these tasks done??

PT


0
ptrennum
Asked:
ptrennum
  • 10
  • 7
1 Solution
 
AxterCommented:
Hi ptrennum,
> >Create 4 directories:
In your *.iss scrip file, add the following sectiion

[Dirs]
Name: "{app}"
Name: "{app}\dir1"
Name: "{app}\dir2"
Name: "{app}\dir3"


David Maisonave :-)
Cheers!
0
 
jkrCommented:
There's a fully documented sample available at their web page:http://news.jrsoftware.org/news/innosetup/iss00027.iss

Also, you'll find a lot of information at http://is-ar.webhop.org/ and http://www.jrsoftware.org/isfaq.php
0
 
AxterCommented:
ptrennum,
> >move 2 dll's to system 32 directory and register them
In Files section, add following:
[Files]
Source: "CTL3DV2.DLL"; DestDir: "{sys}";


David Maisonave :-}
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
ptrennumAuthor Commented:
I figured out the directories
do you have any idea how to do the other tasks?

PT
0
 
AxterCommented:
ptrennum,
> >copy 3 files to c:\dir\dir1

[Files]
Source: "myfile.txt"; DestDir: "{app}\dir1";

David Maisonave :-}
0
 
AxterCommented:
ptrennum,
> >then run one of the files copied (file.exe)

[Run]
Filename: "{app}\dir1\file.exe"; Parameters: "auto"

David Maisonave :-}
0
 
AxterCommented:
ptrennum,
> >then force a reboot

[Setup]
RestartIfNeededByRun=yes

David Maisonave :-}
0
 
AxterCommented:
I recommend you use the INNO help menu.
It's very good, and all you have to do is do a keyword search, like "reboot".
0
 
ptrennumAuthor Commented:
When I run the installer it seems to create a System directory under the main directory, I did not ask it to do that.  Is there a way to stop it from making a system directory automatically?

PT
0
 
AxterCommented:
>>Is there a way to stop it from making a system directory automatically?

Please post your script.
It's probably in the script.
0
 
ptrennumAuthor Commented:
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\ShacoOnlineBackup
DisableDirPage=yes
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Dirs]
;Name: "{app}"
;Name: "{app}\dir1"
Name: "{app}\Data"
Name: "{app}\Logs"

[Files]
Source: "C:\Documents and Settings\peter\Desktop\Shac62\ShacoOnlineBackupService\ClientInstallation\ShacoServiceInterface.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Documents and Settings\peter\Desktop\Shac62\ShacoOnlineBackupService\ClientInstallation\ShacoService.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Documents and Settings\peter\Desktop\Shac62\ShacoOnlineBackupService\ClientInstallation\mfc71d.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Documents and Settings\peter\Desktop\Shac62\ShacoOnlineBackupService\ClientInstallation\msvcr71d.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Documents and Settings\peter\Desktop\Shac62\ShacoOnlineBackupService\ClientInstallation\ServiceInstaller.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent
0
 
AxterCommented:
>>it seems to create a System directory under the main directory,

Are you sure the application that you have under [run] is not the one creatnig the system directory.

I don't see any commands to create a system directory, and it should not be  creating the system directory unless you explicitly ask it to.
0
 
ptrennumAuthor Commented:
I removed the run command and it still created the System directory.
0
 
ptrennumAuthor Commented:
Wherever this: {app} is defined is where the system directory is being created.

{app} seems to think it's C:\Dir\System

PT
0
 
AxterCommented:
>>I removed the run command and it still created the System directory.

Can you post the full path that it's creating, so we're sure we're talking about the samething?
0
 
ptrennumAuthor Commented:
Here is the script:
#define MyAppName "Shaco Online Backup"
#define MyAppVerName "ShacoOnlineBackup Beta 1.0"
#define MyAppPublisher "Shaco Enterprises, Inc."
#define MyAppURL "http://www.shacoenterprises.com"
#define MyAppExeName "ShacoServiceInterface.exe"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\ShacoOnlineBackup
DisableDirPage=yes
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon



It creates a directory like this:
C:\ShacoOnlineBackup\System

in that directory is the uninstall files

PT
0
 
AxterCommented:
I recommend you try above scrip with out preprocessor commands.

IMHO, using preprocessor commands will make your script much more complicated then what it needs to be, and you never know what the preprocessor is adding.
0
 
ptrennumAuthor Commented:
THanks axter you were a huge help!!

PT
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 10
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now