Subject Re: Creating a application
From john marshall <john@nospam.com>
Date Mon, 28 Sep 2009 11:32:26 -0400
Newsgroups dbase.getting-started
Attachment(s) GrataSoft.iss

Scott:

  You need to actually install dBase runtime on each client machine for the app to run (even though it is an .exe).

The Inno part can automate this process, but personally, I prefer to do this apart from the project explorer.  My favorite is ISTool along with inno 5, a really nice user interface to the process.  I have attached my install script as a starting point for you to see lots of stuff.  It also addresses 3 separate processes:  Server Install, Workstations install, and update.  I have to give credit to Ken Mayer for the starting portion of this, and jonny for the code segment that prompts the user to point to the data folder.  Please notice that you can insert values into the ini, create BDE aliases and execute the runtime install (or other setup routines.).

Good luck, and let us know if you need more insights - it's not as bad as it first appears.

JM




Scott Wrote:

> Trying to follow every step by the letter. Made an executable none DEO file, works fine. combined into folder with .ini file, Plusrun.exe, PLUSr_en.dll, resouce.dll. Will not execute when taken to a non dbase computer. I really do not have a clue why not or what to do next. Any help would be appreciated. I do not understand inno and the rest of setting up that portion of project explorer if needed. Seems so many steps are like pulling teeth.  




[_TopOfScript]
; This is a Innoscript generate with ScriptMaker version  5.1.0.1

[_Project]
ProjectAccessDate=11/27/2007 12:01:19 PM
;
ProjectNr=4.1.3.10
ProjectName=GrataSoft Tip & Gratuity Management
ProjectExeFileName=C:\Program Files\dBASE\PLUS\Samples\TIP\Tip.exe
ProjectMainFileName=C:\Program Files\Inno Setup 5\Examples\GrataSoft.iss
ProjectAuthor=John Marshall
ProjectCreateDate=11/27/2007
ProjectdBaseVersion=dBASE PLUS 2.613 b1811
ProjectLastdBaseRuntimeVersion=
ProjectLastdBaseRuntimeLanguage=
ProjectdBasePRJFilename=C:\Program Files\dBASE\PLUS\Samples\TIP\tip.prj

[_ISPP]
#Pragma Option -v+
#Pragma VerboseLevel 9 ;Macro and functions successfull call acknowledgements
#Pragma SpanSymbol "\"
#define AppVersion "4.1"
#define AppID "GrataSoft Tip & Gratuity Management"
#define AppCopyright "2005-2009"

#define MyAppName "GrataSoft Tip & Gratuity Management"
#define MyAppVerName "GrataSoft 4.1"
#define MyAppExeName "Tip.exe"
#define dBaseFolder ReadReg(HKEY_LOCAL_MACHINE,"SOFTWARE\dBASE\PLUS\series1", "RuntimePath")
#define MyAppPublisher "GrataSoft Solutions"
#define MyAppURL "http://GrataSoft.com"


[dBASERuntime]
#define SM_dBASERuntime "false"

[_EndOfScript]
; © HiSoft2000 http://www.Hisoft2000.de Mail: HiSoft2000@HiSoft2000.de © 2002-2004
; Visual dBase, dB2K, dBase SE and dBase Plus © dataBased Intelligence.Inc Homepage: http://www.databi.com/
; dQuery for Delphi,C++,dBASE PLUS © dataBased Intelligence.Inc see also Homepage: http://www.dQuery.com/

[Setup]
; If left at the default, this will show the components
; to be installed to the user, which could confuse them.
AlwaysShowComponentsList=false
; Used in the uninstall log:
AppID=GrataSoft Tip & Gratuity Management
; Required - used to display the name of the application
; in several locations throughout the install.
AppName=GrataSoft Tip & Gratuity Management
; These three are optional, but are displayed in the
; Windows 2000/XP/2003 (Vista?) Add/Remove Program
; applet ...
AppPublisher=GrataSoft Solutions
AppPublisherURL=http://www.grastasoft.com/
AppVersion=4.1
; Required: Should be the same text as AppName but include version
; number ...
AppVerName=GrataSoft Tip & Gratuity Management version 4.1
; Required: displays default install location. The
; constant {sd} is the system drive.
DefaultDirName={pf}\GrataSoft
; This is where the install wants to go by default
;
; Name of the group in the Programs menu of Windows.
DefaultGroupName=GrataSoft Solutions
; Defaults to "auto", if the folder installing to already
; exists, it asks if the Installer should overwrite the folder.
DirExistsWarning=auto
; Disables the question about "This will install ...
; Do you want to continue?"
DisableStartupPrompt=true
; Used on XP or Vista for installation rights.
; Where is the default source for the application?
; This information is used in the FILES section below.
SourceDir=C:\Program Files\dBASE\PLUS\Samples\TIP
; Output directory -- where the install program
; gets created (this will be "under" the source, i.e,
; C:\MyAppSource\InstallImage):
OutputDir=InstallImage
; Name of program to run (name of installer program)
OutputBaseFilename=GrataSoft_Setup

; Appearance of the Installer:
SetupIconFile=compiler:Examples\Setup.ico
WizardImageBackColor=clGreen
WizardImageFile=compiler:wizmodernimage-is.bmp
WizardImageStretch=false
AppCopyright=Copyright 2006-2009 GrataSoft Solutions
EnableDirDoesntExistWarning=false
LicenseFile=C:\Documents and Settings\johnm\My Documents\Corporate\GrataSoft\Software License no 3rd party.rtf
WizardSmallImageFile=compiler:wizmodernsmallimage-is.bmp
UserInfoPage=true
UsePreviousUserInfo=true

; -----------------------------------------------------------------------------------------------------

DisableDirPage=false
AllowRootDirectory=false
AllowUNCPath=false
;
;     Define the three use choise types:
[Types]
Name: Network; Description: Network Install -- Data and program files to network drive or Main machine
Name: Workstation; Description: Workstation Install -- for local workstation, installs Invoice program and needed files
Name: Upgrade; Description: "Program File Upgrade -- installs latest versions of all program files "

; -----------------------------------------------------------------------------------------------------
;     Components go with the types:

[Components]
Name: Net; Types: Network; Description: Network Server Install
Name: WS; Description: Workstation Install; Types: Workstation
Name: UP; Description: Update Program Files Only; Types: Upgrade
; -----------------------------------------------------------------------------------------------------
;     Set up the directories on the network, the "Permissions"
;     flags are for Vista, the 'FULL' is important for
;     any folder that your application changes any files
;     outside of the .exe (tables, .ini files, etc.):

[INI]
;    Attempt to write/modify the INI file to specify DEO folders and def system settings:
;
;    Create DEO Paths in INI ...
Filename: {app}\program\tip.ini; Section: ObjectPath; Key: objPath2; String: {app}\program; Components: Net; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: ObjectPath; Key: objPath1; String: {app}\Data; Components: Net; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: ObjectPath; Key: objPath1; String: {code:GetNetDir}\Data; Components: WS; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: ObjectPath; Key: objPath2; String: {app}\program; Components: WS; Flags: createkeyifdoesntexist
;
;
; -----------------------------------------------------------------------------------------------------
;    Set defaults for Ws & Server INI entries ...
Filename: {app}\program\tip.ini; Section: POS; Key: Server; String: Y; Components: Net; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: POS; Key: Server; String: N; Components: WS; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: POS; Key: PollOnStart; String: N; Components: WS Net; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: POS; Key: Current; String: N; Flags: createkeyifdoesntexist; Components: Net
Filename: {app}\program\tip.ini; Section: POS; Key: Allocation; String: N; Flags: createkeyifdoesntexist; Components: Net WS
Filename: {app}\program\tip.ini; Section: POS; Key: TRDA; String: N; Flags: createkeyifdoesntexist; Components: Net WS
Filename: {app}\program\tip.ini; Section: POS; Key: ATIP; String: N; Flags: createkeyifdoesntexist; Components: Net WS
Filename: {app}\program\tip.ini; Section: ObjectPath; Key: objPath3; String: {app}\duflp; Components: WS Net; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: ObjectPath; Key: objPath5; String: {app}\misc; Components: WS Net; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: ObjectPath; Key: objPath4; String: {app}\bin; Components: WS Net; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: CommandSettings; Key: ldriver; String: DB437US0; Components: WS Net; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: CommandWindow; Key: ResultsPaneFont; String: Courier New, 9; Components: WS Net; Flags: createkeyifdoesntexist
Filename: {app}\program\tip.ini; Section: CommandWindow; Key: InputPaneFont; String: Courier New, 10; Components: WS Net; Flags: createkeyifdoesntexist

[Dirs]
;
;     Create Working folders
;
Name: {app}\Program; Permissions: everyone-full; Components: " WS Net"; Flags: uninsneveruninstall
Name: {app}\Data; Flags: uninsneveruninstall; Components: " WS Net"; Permissions: everyone-full
Name: {app}\duflp; Flags: uninsneveruninstall; Components: " WS Net"; Permissions: everyone-full

;    Name: {app}\dUFLP; Permissions: everyone-readexec; Components: Net
;    Name: {app}\Other; Permissions: everyone-readexec; Components: Net
;    Name: {app}\Images; Permissions: everyone-readexec; Components: Net
;    Name: {app}\Tables; Permissions: everyone-full; Components: Net

;       Where to install the dBASE Plus Runtime and
;       the BDE:
Name: {pf}\dBASE\Plus\Runtime; Permissions: everyone-full; Flags: uninsneveruninstall
Name: {cf}\Borland Shared\BDE; Permissions: everyone-full; Flags: uninsneveruninstall

; -----------------------------------------------------------------------------------------------------
Name: {app}\bin; Flags: uninsneveruninstall; Permissions: everyone-full; Components: WS Net
Name: {app}\misc; Flags: uninsneveruninstall; Permissions: everyone-full; Components: WS Net
Name: {app}\Export; Permissions: everyone-full; Flags: uninsneveruninstall; Components: WS Net
Name: {app}\Import; Permissions: everyone-full; Flags: uninsneveruninstall; Components: WS Net
Name: {app}\Samples; Permissions: everyone-full; Flags: uninsneveruninstall; Components: WS Net

[Files]
; Files to be installed.

; Network install:
; None of these files in the network install should be uninstalled if that option is run --
; the Workstation application relies on these existing.
;     Source: dUFLP\*.*; DestDir: {app}\dUFLP; Components: Net; Flags: ignoreversion uninsneveruninstall
;     Source: Main\*.*; DestDir: {app}\Main; Components: Net; Flags: ignoreversion uninsneveruninstall
;     Source: Other\*.*; DestDir: {app}\Other; Components: Net; Flags: ignoreversion uninsneveruninstall
;     Source: Images\*.*; DestDir: {app}\Images; Components: Net; Flags: ignoreversion uninsneveruninstall
; Tables -- you don't want to overwrite them if they exist ... Also don't ever uninstall ...
;     Source: EmptyTablesForInstall\*.*; DestDir: {app}\Tables; Components: Net; Flags: onlyifdoesntexist uninsneveruninstall
;
; Needed for the ImportData routine, NET only:
;     Source: ImportData.exe; DestDir: {app}; Components: Net; Flags: ignoreversion
;
Source: G:\GrataSoft 4.1 Production\Tip.INI; DestDir: {app}\program; Components: Net WS; Flags: uninsneveruninstall onlyifdoesntexist
;
; Workstations:
;     Source: MBIInvoice.exe; DestDir: {app}; Components: WS; Flags: ignoreversion

; all machines:
;     Source: GSPRES32.DLL; DestDir: {app}; Flags: ignoreversion

; dBASE Runtime Installer
Source: G:\GrataSoft 4.1 Production\Runtime\PlusRuntime-b2059_EN.exe; DestDir: {tmp}; Flags: ignoreversion deleteafterinstall; Components: WS Net
; this will be run to ensure permissions for the BDE ...
Source: G:\GrataSoft 4.1 Production\Runtime\setacl.exe; DestDir: {tmp}; Flags: deleteafterinstall; MinVersion: 0,4.0.1381

; Manifest files required for Windows Vista:
Source: ..\..\..\..\dbaseRT\plusrun.exe.manifest; DestDir: {pf}\dBASE\Plus\Runtime; Components: " WS Net"; Flags: uninsneveruninstall onlyifdoesntexist; Permissions: everyone-readexec
Source: ..\..\..\..\dbaseRT\bdeadmin.exe.manifest; DestDir: {cf}\Borland Shared\BDE; Components: " WS Net"; Flags: uninsneveruninstall onlyifdoesntexist
Source: ..\..\..\..\dbaseRT\tip.exe.manifest; DestDir: {app}\program; Components: " WS Net"; Flags: onlyifdoesntexist

;Source: C:\Program Files\dBASE\PLUS\VistaManifest\Administrator\plusrun.exe.manifest; DestDir: {pf}\dBASE\Plus\Runtime
;Source: C:\Program Files\dBASE\PLUS\VistaManifest\Administrator\bdeadmin.exe.manifest; DestDir: {cf}\Borland Shared\BDE

; -----------------------------------------------------------------------------------------------------
Source: G:\GrataSoft 4.1 Production\Empty Tables\*.*; DestDir: {app}\data; Components: Net; Flags: uninsneveruninstall onlyifdoesntexist
Source: G:\GrataSoft 4.1 Production\Programs\*.*; DestDir: {app}\program; Components: UP WS Net; Flags: ignoreversion
;
;Source: AddAlias.exe; DestDir: {tmp}; Components: up
;
Source: G:\GrataSoft 4.1 Production\Tip.exe; DestDir: {app}\program; Components: Net WS UP; Flags: ignoreversion
Source: G:\GrataSoft 4.1 Production\BDE\AddAlias.exe; DestDir: {tmp}; Components: WS Net; Flags: onlyifdoesntexist
Source: G:\GrataSoft 4.1 Production\bin\*.*; DestDir: {app}\bin; Components: UP WS Net; Flags: ignoreversion
Source: G:\GrataSoft 4.1 Production\misc\*.*; DestDir: {app}\misc; Components: UP WS Net; Flags: ignoreversion restartreplace
Source: G:\GrataSoft 4.1 Production\duflp\*.*; DestDir: {app}\duflp; Components: UP WS Net; Flags: ignoreversion restartreplace
Source: G:\GrataSoft 4.1 Production\sample tables\*.*; DestDir: {app}\samples; Components: Net; Flags: ignoreversion restartreplace uninsneveruninstall onlyifdoesntexist
Source: G:\GrataSoft 4.1 Production\Misc\CheckTablet.ico; DestDir: {app}; Components: WS Net
[Icons]
Name: {group}\GrataSoft Tip Management; Filename: {app}\program\Tip.exe; WorkingDir: {app}\program; Components: WS Net; IconFilename: {app}\checktablet.ico; Tasks: ; IconIndex: 0
;Name: {group}\Import Data; Filename: {app}\ImportData.exe; WorkingDir: {app}; Components: Net
; BDEAdmin ...
Name: {group}\BDE Administrator; Filename: {cf}\Borland Shared\BDE\BDEAdmin.exe; WorkingDir: {cf}\Borland Shared\BDE
; Desktop icons:
Name: {userdesktop}\GrataSoft Tip Management; Filename: {app}\program\Tip.exe; WorkingDir: {app}\program; Components: WS Net; IconFilename: {app}\checktablet.ico; IconIndex: 0
;Name: {userdesktop}\Import Data; Filename: {app}\ImportData.exe; WorkingDir: {app}; Components: Net

; -----------------------------------------------------------------------------------------------------
; here's the important part -- we need to try to get the
; path to the files on the network here ...
; This code courtesy of Jonny Kwekkeboom
Name: {commondesktop}\GrataSoft Tip Management; Filename: {app}\program\Tip.exe; WorkingDir: {app}\program; Components: WS Net; IconFilename: {app}\checktablet.ico; Tasks: Desktopicon; IconIndex: 0
Name: {group}\Uninstall GrataSoft Tip Management; Filename: {uninstallexe}; Components: WS Net; Tasks:
[Run]
; Silent install of runtime suppresses the runtime install display, and the installshield stuff ...
; PlusRuntime-bNNNN_en.exe -s -a Runtime=d:\dBASEPLUS\Runtime BDE=d:\dBASEPLUS\bde Silent -sr
; In order to get this to work properly, the double-quotes are doubled up in a few places
; if you look at the statement ... that embeds a single double-quote (as it were) in the
; parameters needed for the runtime and bde installs.
Filename: {tmp}\PlusRuntime-b2059_EN.exe; Parameters: "-s -a Runtime=""{pf}\dBASE\Plus\Runtime"" BDE=""{cf}\Borland Shared\BDE"" Silent -sr"; StatusMsg: Installing dBASE Runtime and BDE...; WorkingDir: {tmp}; Components: WS Net

; setAcl is used to give users full access to the registry keys at HKLM\SOFTWARE\Borland
Filename: {tmp}\setacl.exe; Parameters: MACHINE\SOFTWARE\Borland /registry /grant S-1-1-0 /set_val /sid; WorkingDir: {tmp}; Minversion: 0,4.0.1381; Components: WS Net; Flags: runascurrentuser

; -----------------------------------------------------------------------------------------------------
;Filename: {tmp}\AddAlias.exe; Parameters: """GrataSoft"" ""{app}\data"" ""DBASE"""; Components: " UP"
; Alias PRTIP
;Filename: {tmp}\AddAlias.exe; Parameters: """PRTIP"" ""{code:GetNetDirData}\data"" ""DBASE"""; Components: WS Net; WorkingDir: {tmp}
;  Can add a subfolder here, or in code like below.
Filename: {tmp}\AddAlias.exe; Parameters: """-PRTIP"" ""{code:GetNetDirData}"" ""DBASE"""; Components: WS Net; WorkingDir: {tmp}; Flags: runascurrentuser
;Filename: {tmp}\AddAlias.exe; Parameters: """PRTIP"" ""{CODE:GetLastDir}"" ""DBASE"""; Components: WS Net; WorkingDir: {tmp}
Filename: {tmp}\AddAlias.exe; Parameters: """-TIP"" ""{code:GetNetDir}"" ""DBASE"""; Components: WS Net; WorkingDir: {tmp}; Flags: runascurrentuser

[_ISTool]
UseAbsolutePaths=true
[Code]
var
  NetDirPage: TInputDirWizardPage;
  cNetDirDefault: String;

procedure InitializeWizard_NetDir;
var cTitle, cLabel, cDesc:String;
begin
  { Create the pages }

  cNetDirDefault := '{app}';
  cTitle := 'Select GrataSoft Directory on Network Drive'
  cLabel := 'Choose directory on the Network Drive where GrataSoft files are installed.'
  cDesc  := 'Choose the folder on the network drive that has the subfolders "Data", etc. - this is most likely "Y:\GrataSoft"'
  NetDirPage := CreateInputDirPage( wpSelectDir, cTitle, cLabel, cDesc, False, '' );
  NetDirPage.add('');
  NetDirPage.Values[0] := '';

end;

function GetNetDir( Param: String): String;
begin
   Result := NetDirPage.Values[0];
end;

function GetNetDirData( Param: String): String;
Var
   S: String;
begin
   S := NetDirPage.Values[0];
   If DirExists(S) then
      Result := Addbackslash(S) + 'Data'
   Else
      Result := S;
end;

procedure CurPageChanged( CurPageID: Integer);
begin
   Case CurPageID of
        NetDirPage.ID: begin
              NetDirPage.Values[0] := ExpandConstant( cNetDirDefault );
              if NetDirPage.Values[0] = '' then
                 NetDirPage.Values[0] := ExpandConstant( cNetDirDefault );
              end;
        end;
   #If 'true' == SM_dBASERuntime
       if CurPageID=wpReady then
          CalldBASERuntimeSetup;
   #EndIf
end;

procedure InitializeWizard();
begin
    InitializeWizard_NetDir;
end;
[Tasks]
Name: Desktopicon; Description: Create a &desktop icon; GroupDescription: additional icons; Components: WS Net
Name: desktopicon\common; Description: For all users; GroupDescription: Additional icons; Flags: exclusive; Components: WS Net
Name: desktopicon\user; Description: For the current user only; GroupDescription: Additional icons; Components: WS Net
Name: quicklaunchicon; Description: create a &Quick Launch icon; GroupDescription: Additional icons; Components: WS Net
Name: associate; Description: &Associate files; GroupDescription: Other Tasks; Components: WS Net
[Languages]
Name: english; MessagesFile: compiler:Default.isl