?
Solved

Inno Setup questions (User Levels)

Posted on 2009-05-01
9
Medium Priority
?
3,439 Views
Last Modified: 2013-11-09
Can anyone show me how to create setup using Inno Setup for different user license, example installation option for  SIngle User License and Network License?
0
Comment
Question by:COOMET
  • 5
  • 4
9 Comments
 
LVL 18

Expert Comment

by:mirtheil
ID: 24279581
Check out the CodeDlg.iss sample in the Examples directory of your InnoSetup install.  It shows how to deal with multiple license models.  
0
 

Author Comment

by:COOMET
ID: 24336638
mirtheil,

thanks for your comment.  I have seen that example but do not really know the scripting language.  Is there no a line of standard command of Inno Setup to distinguish single license and site license? At this stage I am looking for two classes of license: single user license and multiple user license.  Have you applied that script?

 
0
 
LVL 18

Expert Comment

by:mirtheil
ID: 24336925
To be honest, in my applications, I don't rely on the installer for validating or restricting the license.  

In my opinion, the application should handle the license.  

Back to your question, how you implement a single user vs multiple user license in the installer depends on a few things.  First, how is the license implemented?  Is it a different key or different registry entry or a different installed file or something else?

I'm attaching a simpler example of the CodeDlg.iss that is geared more to a single/multiple user license.  There's a line in the code that shows where to add your logic.  If you have questions on how to implement that logic, post up how you need to apply the license.
; -- CodeDlg.iss --
;
; This script shows how to insert custom wizard pages into Setup and how to handle
; these pages. Furthermore it shows how to 'communicate' between the [Code] section
; and the regular Inno Setup sections using {code:...} constants. Finally it shows
; how to customize the settings text on the 'Ready To Install' page.
 
[Setup]
AppName=My Program
AppVerName=My Program version 1.5
DefaultDirName={pf}\My Program
DisableProgramGroupPage=yes
UninstallDisplayIcon={app}\MyProg.exe
OutputDir=userdocs:Inno Setup Examples Output
 
[Files]
Source: "MyProg.exe"; DestDir: "{app}"
 
 
[Code]
var
  UsagePage: TInputOptionWizardPage;
  KeyPage: TInputQueryWizardPage;
  ProgressPage: TOutputProgressWizardPage;
  DataDirPage: TInputDirWizardPage;
  
procedure InitializeWizard;
begin
  { Create the pages }
  UsagePage := CreateInputOptionPage(wpWelcome,
    'Personal Information', 'How will you use My Program?',
    'Please specify how you would like to use My Program, then click Next.',
    True, False);
  UsagePage.Add('Single User mode');
  UsagePage.Add('Multiple User mode');
 
  KeyPage := CreateInputQueryPage(UsagePage.ID,
    'Personal Information', 'What''s your registration key?',
    'Please specify your registration key and click Next to continue. If you don''t ' +
    'have a valid registration key, click Back to choose a different usage mode.');
  KeyPage.Add('Registration key:', False);
 
  ProgressPage := CreateOutputProgressPage('Personal Information',
    'What''s your registration key?');
 
 
  { Set default values, using settings that were stored last time if possible }
 
  case GetPreviousData('UsageMode', '') of
    'single': UsagePage.SelectedValueIndex := 0;
    'multi': UsagePage.SelectedValueIndex := 1;
  else
    UsagePage.SelectedValueIndex := 1;
  end;
 
end;
 
procedure RegisterPreviousData(PreviousDataKey: Integer);
var
  UsageMode: String;
begin
  { Store the settings so we can restore them next time }
  case UsagePage.SelectedValueIndex of
    0: UsageMode := 'single';
    1: UsageMode := 'multi';
  end;
  SetPreviousData(PreviousDataKey, 'UsageMode', UsageMode);
end;
 
function ShouldSkipPage(PageID: Integer): Boolean;
begin
end;
 
function NextButtonClick(CurPageID: Integer): Boolean;
var
  I: Integer;
begin
  { Validate certain pages before allowing the user to proceed }
  if CurPageID = KeyPage.ID then begin
    { Just to show how 'OutputProgress' pages work.
      Always use a try..finally between the Show and Hide calls as shown below. }
    ProgressPage.SetText('Authorizing registration key...', '');
    ProgressPage.SetProgress(0, 0);
    ProgressPage.Show;
    try
      for I := 0 to 10 do begin
        ProgressPage.SetProgress(I, 10);
        Sleep(100);
      end;
    finally
      ProgressPage.Hide;
    end;
    {Here's where you'd validate the key}
    if KeyPage.Values[0] = 'inno' then
      Result := True
    else begin
      MsgBox('You must enter a valid registration key. (Hint: The key is "inno".)', mbError, MB_OK);
      Result := False;
    end;
  end else
    Result := True;
end;
 
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo,
  MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  S: String;
begin
  { Fill the 'Ready Memo' with the normal settings and the custom settings }
  S := '';
  S := S + 'Personal Information:' + NewLine;
 S := S + NewLine;
  
  S := S + 'Usage Mode:' + NewLine + Space;
  case UsagePage.SelectedValueIndex of
    0: S := S + 'Single User mode';
    1: S := S + 'Multiple User mode';
  end;
  S := S + NewLine + NewLine;
  
  S := S + MemoDirInfo + NewLine;
 
  Result := S;
end;

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:COOMET
ID: 24345006
thanks Mertheil.  In case of multiple users, I thought of installing the application through one license keys through the admin account so that all connected users can use the application.  Otherwise, the application would be functional only for the user account where the program is installed.  By the way, to enter the license keys, I have already a few line of code integrated in the application.  For the time being, that code register only the account holder where the application is installed.  Inno installs a copy for all users in the network.  

Thanks again.
0
 
LVL 18

Expert Comment

by:mirtheil
ID: 24350698
> Inno installs a copy for all users in the network.
Actually, Inno only does what you tell it to do.  If you tell it to copy to a location for all users, that's what it will do.  

Why don't you post your script and tell us what behavior you are seeing and what you want it to do.
0
 

Author Comment

by:COOMET
ID: 24388184
"Actually, Inno only does what you tell it to do.  If you tell it to copy to a location for all users, that's what it will do. "

So, where can we see or order Inno to make a copy for all users or only one user. That is exactly my point.  I am not saying the shortcut on the desktop.    

"Why don't you post your script and tell us what behavior you are seeing and what you want it to do."

Below, I am attaching the default setup scrip I use very often.

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
 
#define MyAppName "My Program"
#define MyAppVerName "My Program 1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
 
[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={{73DDB3FA-D843-41F1-A025-9514B8FDB377}
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
 
[Languages]
Name: english; MessagesFile: compiler:Default.isl
 
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
 
[Files]
Source: C:\Program Files\Inno Setup 5\Examples\MyProg.exe; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
 
[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon
 
[Run]
Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent

Open in new window

0
 
LVL 18

Accepted Solution

by:
mirtheil earned 200 total points
ID: 24388739
>>So, where can we see or order Inno to make a copy for all users or only one user. That is exactly my point.  I am not saying the shortcut on the desktop.    

Taking this line:
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon

The desktop icon will be created in the "common" desktop which is available for All users.  If you want it on the User's desktop only, the line needs to be:
Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon

Now, that being said, you'll need to determine what is the best way to decide whether to install to the User Desktop or Common Desktop.  
0
 

Author Comment

by:COOMET
ID: 24394194
mirtheil, thanks a lot!
0
 

Author Closing Comment

by:COOMET
ID: 31576875
Thanks a lot for going all along till the point I was in need of help!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the frequent problems with the installations is when some file or registry entry is not removed from the system upon un-installation of the product. Clean removal is always highly desirable. One major reason for that is badly authored inst…
Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month16 days, 15 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question