Hi

Sorry I jumped late in this thread. Here is my InnoSetup script which
installs the Visual FoxPro runtime and MySQL driver. They are defined
as tasks and show on last page as checkboxes (default checked). It
also deletes files created by the application itself after install
(such as foxuser.*), so the directory is deleted as well upon
uninstallation.

Ah, almost forgot: it also gives read-write access rights to everyone
on the application folder (thus you can install it under Program Files
in Windows Vista / Windows 7 and have no access rights issues).

I copied the entire script here; please check the Tasks and Run sections.

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

#define MyAppName "ADM Framework"
#define MyAppVersion "1.1.46"
#define MyAppVerName "ADM Framework 1.1.46"
#define MyAppPublisher "ADM Farm SRL"
#define MyAppURL "http://www.admfarm.ro";
#define MyAppSupportURL "http://it.admfarm.ro";
#define MyAppExeName "ADMApp.exe"
#define MyAppUpdaterName "ClassFwAppUpdater.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={{AEB2AC2F-71A1-4556-A277-CF2107E56EED}
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppSupportURL}
AppUpdatesURL={#MyAppSupportURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=C:\Dev\VFP\ADMApp\kit
OutputBaseFilename=Setup {#MyAppName}
Compression=lzma
SolidCompression=true
InternalCompressLevel=ultra
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany=ADM Farm SRL
VersionInfoDescription=Kit instalare ADM Framework {#MyAppVersion}
VersionInfoCopyright=© 2009 Grigore Dolghin

[Languages]
Name: english; MessagesFile: compiler:Default.isl
;Name: romanian; MessagesFile: compiler:Languages\Romanian.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon};
GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon};
GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: Install_MySQL_ODBC; Description: Install MySQL ODBC Driver;
GroupDescription: Install MySQL ODBC Driver; Flags: checkablealone
Name: Install_VFP_Runtime; Description: Install VFP Runtime;
GroupDescription: Install VFP Runtime; Flags: checkablealone;
Languages:

[Files]
Source: ..\AdmApp.exe; DestDir: {app}; Flags: ignoreversion
Source: ..\application.ini; DestDir: {app}; Flags: ignoreversion
Source: ..\ADMFramework.chm; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: VFP9SP2RT.exe; DestDir: {app}; Flags: deleteafterinstall; Tasks:
Source: runtime.txt; DestDir: {app}; Flags: deleteafterinstall
Source: mysql-connector-odbc-5.1.5-win32.msi; DestDir: {app}; Flags:
deleteafterinstall; Tasks:
Source: msvcp71.dll; DestDir: {sys}; Flags: uninsneveruninstall
Source: ..\..\Common\libs\compress.fll; DestDir: {app}
Source: ..\..\Common\libs\hash.fll; DestDir: {app}
Source: mscomctl.ocx; DestDir: {sys}; Flags: regserver sharedfile
uninsneveruninstall
Source: comctl32.ocx; DestDir: {sys}; Flags: regserver sharedfile
uninsneveruninstall
Source: ..\ClassFwAppUpdater.exe; DestDir: {app}; Flags: ignoreversion
Source: localconfig.ini; DestDir: {app}
Source: msvcr71.dll; DestDir: {sys}; Flags: uninsneveruninstall

[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppUpdaterName};
WorkingDir: {app}; IconFilename: {app}\ADMApp.exe; IconIndex: 0
Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL}
Name: {group}\{cm:ProgramOnTheWeb,Suport {#MyAppName}}; Filename:
{#MyAppSupportURL}
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
Name: {commondesktop}\{#MyAppName}; Filename:
{app}\{#MyAppUpdaterName}; Tasks: desktopicon; WorkingDir: {app};
IconFilename: {app}\ADMApp.exe; IconIndex: 0
Name: {userappdata}\Microsoft\Internet Explorer\Quick
Launch\{#MyAppName}; Filename: {app}\{#MyAppUpdaterName}; Tasks:
quicklaunchicon

[Run]
Filename: {app}\{#MyAppUpdaterName}; Description:
{cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall
skipifsilent; Tasks: ; Languages:
Filename: {sys}\msiexec.exe; Tasks: " Install_MySQL_ODBC"; StatusMsg:
Install MySQL ODBC driver; WorkingDir: {app}; Parameters: /i
mysql-connector-odbc-5.1.5-win32.msi /quiet; Languages:
Filename: {app}\VFP9SP2RT.exe; Parameters: /s /M=runtime.txt;
WorkingDir: {app}; Tasks: Install_VFP_Runtime; Languages:

[UninstallDelete]
Name: {app}\foxuser.dbf; Type: filesandordirs
Name: {app}\foxuser.fpt; Type: filesandordirs
Name: {app}; Type: dirifempty
Name: {app}\localconfig.ini; Type: filesandordirs
Name: {app}\audit.log; Type: filesandordirs
Name: {app}\AppUpdate.log; Type: filesandordirs
Name: {app}\Error.log; Type: filesandordirs

[Dirs]
Name: {app}; Permissions: everyone-modify


On Tue, May 11, 2010 at 1:37 AM, MB Software Solutions, LLC
<[email protected]> wrote:
> Tracy Pearson wrote:
>> MB Software Solutions,        LLC wrote on 2010-04-19:
>>> Is PASCAL scripting in Inno just like the Pascal I learned bazillion
>>> (actually 21) years ago?  Sheesh...gotta search the internet for
>>> Pascal syntax again...I completely forgot most of it.
>>>
>>> Tips from fellow Inno [Code] section programmers?
>>>
>>>
>>>
>>
>> Mike,
>>
>> Try this untested:
>>
>> **********
>>
>> [file]
>> Source: "filename"; DestDir: "{app}"; AfterInstall: ShouldRunInstall();
>> Flags: onlyifdoesntexist
>>
>> [code]
>> Var
>>   runInstall: Boolean;
>>
>> function ShouldRunInstall();
>> begin
>>   runInstall := True;
>> end;
>>
>> function InitializeSetup(): Boolean;
>> begin
>>   runInstall := False;
>>   Result := True;
>> end;
>
>
> I worked around this by putting this code into the startup of my main.prg:
>
> FUNCTION InstallMySQL() as Logical
> * This will run the setup.exe in the MyODBC subfolder if the expected
> key doesn't exist.
> * The expected key is Software\MySQL AB\MySQL Connector/ODBC 3.51,
> ValueName: Version; ValueData: ?...it would appear that I'm not caring
> about the value...just that there IS one.
>        LOCAL lcKey as String, loRegistry as registry OF
> .\classes\registry.vcx, lnError as Integer, lcValue as String, lcMsg as
> String, lcFile as String, llInstalled as Logical
>        lcKey = "Software\MySQL AB\MySQL Connector/ODBC 3.51"
>        loRegistry = NEWOBJECT("registry",".\classes\registry.vcx")
>        lnError = 
> loRegistry.GetRegKey("Version",@lcValue,lcKey,HKEY_LOCAL_MACHINE)
>        IF lnError <> 0 THEN && problems getting key; assume odbc driver not
> installed
>                llInstalled = .F.
>                lcFile =".\MyODBC\setup.exe"
>                IF FILE(lcFile) THEN
>                        WAIT WINDOW NOWAIT "Launching ODBC setup"
>                        LOCAL loShell
>                        loShell = NEWOBJECT("_ShellExecute", "_environ.vcx")
>                        loShell.ShellExecute(FULLPATH(lcFile))
>                        RELEASE loShell
>                        lcMsg = "The program is now installing a necessary 
> ODBC driver.  Just
> choose the Typical setup, and accept the other defaults to install." + ;
>                                        CR + CR + "Press OK after you have run 
> the ODBC installation."
>                        MESSAGEBOX(lcMsg,64,"ODBC setup necessary.")
>                ENDIF
> *!*                     lnError =
> loRegistry.SetRegKey("Pilot",lcValue,lcKey,HKEY_CURRENT_USER,.T.)
>        ELSE && key is there....ODBC should be properly installed already
>                * do nothing except set flag
>                WAIT WINDOW TIMEOUT 0.5 "ODBC check complete"
>                llInstalled = .T.
>        ENDIF && lnError = 0
>        RETURN llInstalled
> ENDFUNC && InstallMySQL() as Logical
>
>
> So far, it's working well.
>
> --
> Mike Babcock, MCP
> MB Software Solutions, LLC
> President, Chief Software Architect
> http://mbsoftwaresolutions.com
> http://fabmate.com
> http://twitter.com/mbabcock16
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to