; Palm Support Library for Inno Setup ; by Andrew Gregory ; Version 1.9 ; 27 April 2007 ; http://www.scss.com.au/family/andrew/pdas/palm/innosetup/ ; ; Refer to the Palm Conduit Development Kit for API documentation. [CustomMessages] ; General PalmNoHotSync=Could not find Palm HotSync software. Cannot install {#SetupSetting("AppName")}. PalmSelectUsers=Select Palm Users PalmWhichUsers=Which Palm users should use {#SetupSetting("AppName")}? PalmSelectUsersNext=Select the users who are to have {#SetupSetting("AppName")} installed on their Palm computer, then click Next. PalmInstJSync=Installing JSync (may take a few minutes) ... PalmInstCOM=Installing COM support (may take a few minutes) ... ErrNone=No error. ; The error messages below were copied from Palm's "C/C++ Sync Suite Reference" - blame them! ErrNonSpecific=A nonspecific error occurred. ; Conduit Manager Errors ErrConduitMgr=An otherwise nonspecific Conduit Manager error occurred. ErrIndexOutOfRange=The specified index value is out of range. ErrUnableToDelete=The configuration entries for the specified conduit could not be deleted. ErrNoConduit=The specified conduit does not exist. ErrNoMemory=Not enough memory to perform the requested operation. ErrCreatorIdAlreadyInUse=The creator ID that you specified to use as a new creator ID in the configuration entry is already in use. ErrRregistryAccess=Unable to access the conduit configuration entries. ErrUnableToCreateConduit=The conduit could not be registered with HotSync Manager. ErrUnableToSetConduitValue=The specified conduit configuration entry could not be set. ErrInvalidHandle=The specified structure handle is not valid. ErrBufferTooSmall=The buffer is too small to hold the requested information. ErrValueNotFound=The specified value could not be found in the configuration entries for this conduit. ErrInvalidCreatorId=The specified conduit creator ID is not valid. ErrInvalidPointer=The specified pointer is not a valid pointer. ErrUnableToInstallOld=ErrUnableToInstallOld ErrInvalidConduitType=The specified conduit type is not valid. You must use one of the Conduit Information Type Constants. ErrInvalidCOMPortType=The specified communications port type is not valid. You must use one of the Conduit Communications Port Constants. ErrNoLongerSupported=The value or feature that you specified is no longer supported. ErrInvalidPath=The specified path is not valid. ErrAlreadyInstalled=The specified conduit or notifier is already installed. ErrStorageAccess=Unable to access the conduit configuration entries. ErrNotifierNotFound=The specified notifier is not registered. ErrInstallIdAlreadyInUse=The specified unique ID for an install conduit is already in use. ErrInvalidInstallId=The specified unique ID for an install conduit is not valid. ; HotSync Manager Errors ErrorHsapiHotSyncNotFound=HotSync Manager is not running. ErrorHsapiInvalidConnType=The specified connection type is not one defined in the HotSync Manager Connection Type (HSConnectionType) Constants. ErrorHsapiFailure=The API cannot communicate with HotSync Manager. ErrorHsapiRegFailure=The API cannot access configuration entries. ErrorHsapiUnknownStatusType=The specified status type is not one defined in the HotSync Manager Status Type (HsStatusType) Constants. ErrorHsapiUnableToClose=The API cannot close the HotSync Manager application. ErrorHsapiNoHotSyncPath=ErrorHsapiNoHotSyncPath ErrorHsapiUnableToStart=The API cannot start the HotSync Manager application. ErrorHsapiInvalidStatusFlag=The specified connection type status is not one defined in the HotSync Manager Connection Type Status Constants. ErrorHsapiInvalidPointer=The pointer passed into this function is not valid. ; Install Aide Errors ErrPilotNoUsers=The users data file does not contain any user information. ErrPilotInvalidUserIndex=The value of the index parameter is greater than the number of users. ErrPilotBufsizeTooSmall=The buffer supplied as a parameter to a function is either too small to contain the information that the function attempted to store or is invalid. ErrPilotNoUsersDatFile=There is no users data file. ErrPilotCopyFailed=The Install Aide could not copy the file. ErrIaInvalidUser=The user name parameter value is either NULL or is not a valid user name. ErrPilotInvalidUser=The user name parameter value is either NULL or is not a valid user name. ErrPilotInvalidFilename=The filename parameter value in a call to an install function is NULL. ErrPilotInvalidFileIndex=The value of the file index parameter passed in is greater than the number of files. ErrPilotUsersDatAlreadyExists= ErrPilotInvalidPathType=The path type parameter value is not one defined in the Install Aide Path Type Constants. ErrPilotInvalidRegistry=The requested path information is not stored in the configuration entries. Running the Palm Desktop installation program often corrects this problem. ErrPilotInvalidPath=The path parameter passed to the PltSetPath function is NULL. ErrPilotFileAlreadyExists=An attempt was made to install a file that is already queued in the user’s install directory on the desktop. ErrPilotInvalidSourceFile=A file passed to the install function is not a valid file or was not found. ErrPilotInvalidIndex=An index parameter exceeds the maximum value allowed for the index. ErrPilotInvalidFileType=A file parameter is not a valid file type for use with the function. ErrPilotInvalidBuffer=A buffer parameter is NULL. ErrPilotInvalidCreatorId=An invalid unique ID was passed to this function. ErrPalmNoCorePath=A value for HotSync Manager’s Core\\Path configuration entry does not exist. The Install Aide cannot retrieve user information without it. ErrPalmUnableToCreateNewFile=Creating a new users data file failed. The users data file did not exist; the Install Aide attempted, but failed to create one. ErrPalmSemaphoreAccess=A sharing problem occurred with the users data file. ErrPalmOtherUsersDatAccessProblem=A miscellaneous error occurred while trying to access the users data file. ErrIaInvalidUserId=The user ID passed to PlmGetUserNameFromID is invalid. ErrPalmFileDeleteFailed=The Install Aide failed to remove the specified install file — for example, the file does not exist. ErrPalmFileMoveFailed=The Install Aide failed to move the specified install file because, for example, the file does not exist. ErrPalmNoDirectory=No directory was found for the specified user. ErrPalmNoUserFile=No users data file found. ErrPalmNoUsers=The users data file does not contain any user information. ErrPalmNotFound=The specified user name could not be found in the database. ErrPalmBadFilename=The specified filename is invalid. ErrPalmUserAccess=The Install Aide cannot access the user data. ErrIaInvalidFileType=The Install Aide does not recognize the file type. #ifdef BUNDLE_JAVA_SUPPORT [Setup] ExtraDiskSpaceRequired=21677631 #endif #ifdef BUNDLE_COM_SUPPORT [Setup] ExtraDiskSpaceRequired=1239028 #endif ; Required DLLs from the CDK [Files] Source: "{#CDK_PATH}\Common\Bin\condmgr.dll"; DestDir: "{app}" Source: "{#CDK_PATH}\Common\Bin\HSAPI.dll"; DestDir: "{app}" Source: "{#CDK_PATH}\Common\Bin\Instaide.dll"; DestDir: "{app}" #ifdef BUNDLE_JAVA_SUPPORT Source: "{#CDK_PATH}\Java\JSync Installer\JSyncInstaller.exe"; DestDir: "{tmp}"; Flags: ignoreversion nocompression ; Updated v6 DLL to fix Java conduit support in v6 desktop software ; Download file from ; and copy to the given source location ; Comment out if you don't need this Source: "{#CDK_PATH}\Java\Bin\sync20.dll"; DestDir: "{code:PalmHotSyncDir}"; Flags: uninsneveruninstall; Check: FileIsVersion(ExpandConstant('{code:PalmHotSyncDir}\sync20.dll'), 6) #endif #ifdef BUNDLE_COM_SUPPORT Source: "{#CDK_PATH}\Com\Installer\PalmCOMInstaller.exe"; DestDir: "{app}"; Flags: nocompression #endif #ifdef BUNDLE_JAVA_SUPPORT [Run] Filename: "{tmp}\JSyncInstaller.exe"; Parameters: "/s -a /s"; StatusMsg: "{cm:PalmInstJSync}" #endif #ifdef BUNDLE_COM_SUPPORT [Run] Filename: "{app}\PalmCOMInstaller.exe"; Parameters: "-s -a -s"; StatusMsg: "{cm:PalmInstCOM}" [UninstallRun] Filename: "{app}\PalmCOMInstaller.exe"; Parameters: "-s -a -uninstall -s" #endif [Code] const ERR_NONE = 0; var PalmUserPage: TInputOptionWizardPage; { Palm user selection wizard page } { * * * * * * * * * * * * Miscellaneous * * * * * * * * * * * * } { Used to stop the v6 sync20.dll update from overwriting a v4 file } function FileIsVersion(Filename: String; majver: Integer): Boolean; var ms: Cardinal; ls: Cardinal; begin Result := False; if GetVersionNumbers(Filename, ms, ls) then if (ms / 65536 ) = majver then Result := True; end; { * * * * * * * * * * * * * * * Conduit Manager API * * * * * * * * * * * * * * * } const CONDUIT_COMPONENT = 0; CONDUIT_APPLICATION = 1; ERR_CONDUIT_MGR = -1000; ERR_INDEX_OUT_OF_RANGE = -1001; ERR_UNABLE_TO_DELETE = -1002; ERR_NO_CONDUIT = -1003; ERR_NO_MEMORY = -1004; ERR_CREATORID_ALREADY_IN_USE = -1005; ERR_REGISTRY_ACCESS = -1006; ERR_UNABLE_TO_CREATE_CONDUIT = -1007; ERR_UNABLE_TO_SET_CONDUIT_VALUE = -1008; ERR_INVALID_HANDLE = -1009; ERR_BUFFER_TOO_SMALL = -1010; ERR_VALUE_NOT_FOUND = -1011; ERR_INVALID_CREATOR_ID = -1012; ERR_INVALID_POINTER = -1013; ERR_UNABLE_TO_INSTALL_OLD = -1014; ERR_INVALID_CONDUIT_TYPE = -1015; ERR_INVALID_COM_PORT_TYPE = -1016; ERR_NO_LONGER_SUPPORTED = -1017; ERR_INVALID_PATH = -1018; ERR_ALREADY_INSTALLED = -1019; ERR_STORAGE_ACCESS = -1020; ERR_NOTIFIER_NOT_FOUND = -1021; ERR_INSTALL_ID_ALREADY_IN_USE = -1022; ERR_INVALID_INSTALL_ID = -1023; function _CmGetHotSyncExecPath(Path: String; var Size: Integer): Integer; external 'CmGetHotSyncExecPath@files:condmgr.dll stdcall setuponly'; function CmGetHotSyncExecPath(var Path: String): Integer; var size: Integer; idx: Integer; begin Path := ' '; size := Length(Path); Result := _CmGetHotSyncExecPath(Path, size); if Result = ERR_BUFFER_TOO_SMALL then begin Path := StringOfChar(' ', size); Result := _CmGetHotSyncExecPath(Path, size); end; if Result = ERR_NONE then begin idx := Pos(StringOfChar(Chr(0), 1), Path); if idx > 0 then SetLength(Path, idx - 1); end else begin Path := ''; end; end; function CmInstallCreator(CreatorID: String; CondType: Integer): Integer; external 'CmInstallCreator@files:condmgr.dll stdcall setuponly'; function CmRemoveConduitByCreatorID(CreatorID: String): Integer; external 'CmRemoveConduitByCreatorID@{app}\condmgr.dll stdcall uninstallonly'; function CmSetCreatorName(CreatorID: String; Name: String): Integer; external 'CmSetCreatorName@files:condmgr.dll stdcall setuponly'; function CmSetCreatorDirectory(CreatorID: String; Directory: String): Integer; external 'CmSetCreatorDirectory@files:condmgr.dll stdcall setuponly'; function CmSetCreatorFile(CreatorID: String; Filename: String): Integer; external 'CmSetCreatorFile@files:condmgr.dll stdcall setuponly'; function CmSetCreatorRemote(CreatorID: String; Remote: String): Integer; external 'CmSetCreatorRemote@files:condmgr.dll stdcall setuponly'; function CmSetCreatorTitle(CreatorID: String; Title: String): Integer; external 'CmSetCreatorTitle@files:condmgr.dll stdcall setuponly'; function CmSetCreatorPriority(CreatorID: String; Priority: Longint): Integer; external 'CmSetCreatorPriority@files:condmgr.dll stdcall setuponly'; function CmSetCreatorInfo(CreatorID: String; Info: String): Integer; external 'CmSetCreatorInfo@files:condmgr.dll stdcall setuponly'; function CmSetCreatorValueString(CreatorID: String; Value: String; Setting: String): Integer; external 'CmSetCreatorValueString@files:condmgr.dll stdcall setuponly'; { * * * * * * * * * * * * * * * HotSync Manager API * * * * * * * * * * * * * * * } const HsCloseApp = 0; HsStartApp = 1; HsRestart = 2; HsReserved = 3; HSFLAG_NONE = 0; ERROR_HSAPI_HOTSYNC_NOT_FOUND = $10000001; ERROR_HSAPI_INVALID_CONN_TYPE = $10000002; ERROR_HSAPI_FAILURE = $10000003; ERROR_HSAPI_REG_FAILURE = $10000004; ERROR_HSAPI_UNKNOWN_STATUS_TYPE = $10000005; ERROR_HSAPI_UNABLE_TO_CLOSE = $10000006; ERROR_HSAPI_NO_HOTSYNC_PATH = $10000007; ERROR_HSAPI_UNABLE_TO_START = $10000008; ERROR_HSAPI_INVALID_STATUS_FLAG = $10000009; ERROR_HSAPI_INVALID_POINTER = $1000000A; function Installer_HsSetAppStatus(StatusType: Integer; StartFlags: Longint): Longint; external 'HsSetAppStatus@files:hsapi.dll stdcall setuponly'; function Uninstaller_HsSetAppStatus(StatusType: Integer; StartFlags: Longint): Longint; external 'HsSetAppStatus@{app}\hsapi.dll stdcall uninstallonly'; function HsSetAppStatus(StatusType: Integer; StartFlags: Longint): Longint; begin if IsUninstaller() then Result := Uninstaller_HsSetAppStatus(StatusType, StartFlags) else Result := Installer_HsSetAppStatus(StatusType, StartFlags); end; function Installer_HsRefreshConduitInfo(): Longint; external 'HsRefreshConduitInfo@files:hsapi.dll stdcall setuponly'; function Uninstaller_HsRefreshConduitInfo(): Longint; external 'HsRefreshConduitInfo@{app}\hsapi.dll stdcall uninstallonly'; function HsRefreshConduitInfo(): Longint; begin if IsUninstaller() then Result := Uninstaller_HsRefreshConduitInfo() else Result := Installer_HsRefreshConduitInfo(); end; { * * * * * * * * * * * * * * Install Aide API * * * * * * * * * * * * * * } const ERR_PILOT_NO_USERS = -500; ERR_PILOT_INVALID_USER_INDEX = -501; ERR_PILOT_BUFSIZE_TOO_SMALL = -502; ERR_PILOT_NO_USERSDAT_FILE = -503; ERR_PILOT_COPY_FAILED = -504; ERR_IA_INVALID_USER = -505; ERR_PILOT_INVALID_USER = -505; ERR_PILOT_INVALID_FILENAME = -506; ERR_PILOT_INVALID_FILE_INDEX = -507; ERR_PILOT_USERSDAT_ALREADY_EXISTS = -508; ERR_PILOT_INVALID_PATH_TYPE = -509; ERR_PILOT_INVALID_REGISTRY = -510; ERR_PILOT_INVALID_PATH = -511; ERR_PILOT_FILE_ALREADY_EXISTS = -512; ERR_PILOT_INVALID_SOURCE_FILE = -513; ERR_PILOT_INVALID_INDEX = -514; ERR_PILOT_INVALID_FILE_TYPE = -515; ERR_PILOT_INVALID_BUFFER = -516; ERR_PILOT_INVALID_CREATORID = -517; ERR_PALM_NO_CORE_PATH = -518; ERR_PALM_UNABLE_TO_CREATE_NEW_FILE = -519; ERR_PALM_SEMAPHORE_ACCESS = -520; ERR_PALM_OTHER_USERSDAT_ACCESS_PROBLEM = -521; ERR_IA_INVALID_USER_ID = -522; ERR_PALM_FILE_DELETE_FAILED = -523; ERR_PALM_FILE_MOVE_FAILED = -524; ERR_PALM_NO_DIRECTORY = -551; ERR_PALM_NO_USER_FILE = -552; ERR_PALM_NO_USERS = -553; ERR_PALM_NOT_FOUND = -554; ERR_PALM_BAD_FILENAME = -555; ERR_PALM_USER_ACCESS = -556; ERR_IA_INVALID_FILE_TYPE = -701; function _PltGetUser(Index: Integer; Name: String; var Size: Shortint): Integer; external 'PltGetUser@files:instaide.dll stdcall setuponly'; function PltGetUser(Index: Integer; var Name: String): Integer; var size: Shortint; begin Name := StringOfChar(' ', 255); size := 0; Result := _PltGetUser(Index, Name, size); if Result = ERR_PILOT_BUFSIZE_TOO_SMALL then begin Name := StringOfChar(' ', size); Result := _PltGetUser(Index, Name, size); end; if Result >= 0 then begin SetLength(Name, Result); end else begin Name := ''; end; end; function PltGetUserCount(): Integer; external 'PltGetUserCount@files:instaide.dll stdcall setuponly'; function PltInstallFile(User: String; Filename: String): Integer; external 'PltInstallFile@files:instaide.dll stdcall setuponly'; function PltGetUsers(): TArrayOfString; var num: Integer; name: String; users: TArrayOfString; idx: Integer; err: Integer; begin num := PltGetUserCount; SetArrayLength(users, num); for idx := 0 to num - 1 do begin err := PltGetUser(idx, name); users[idx] := name; end; Result := users; end; { * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Conduit Installation/Uninstallation Helper Functions * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * } function PalmGetErrorMessage(Err: Longint): String; begin Result := ExpandConstant('{cm:ErrNonSpecific}'); if (Err = ERR_NONE) then Result := ExpandConstant('{cm:ErrNone}'); { Conduit Manager Errors } if (Err = ERR_CONDUIT_MGR ) then Result := ExpandConstant('{cm:ErrConduitMgr}'); if (Err = ERR_INDEX_OUT_OF_RANGE ) then Result := ExpandConstant('{cm:ErrIndexOutOfRange}'); if (Err = ERR_UNABLE_TO_DELETE ) then Result := ExpandConstant('{cm:ErrUnableToDelete}'); if (Err = ERR_NO_CONDUIT ) then Result := ExpandConstant('{cm:ErrNoConduit}'); if (Err = ERR_NO_MEMORY ) then Result := ExpandConstant('{cm:ErrNoMemory}'); if (Err = ERR_CREATORID_ALREADY_IN_USE ) then Result := ExpandConstant('{cm:ErrCreatorIdAlreadyInUse}'); if (Err = ERR_REGISTRY_ACCESS ) then Result := ExpandConstant('{cm:ErrRegistryAccess}'); if (Err = ERR_UNABLE_TO_CREATE_CONDUIT ) then Result := ExpandConstant('{cm:ErrUnableToCreateConduit}'); if (Err = ERR_UNABLE_TO_SET_CONDUIT_VALUE) then Result := ExpandConstant('{cm:ErrUnableToSetConduitValue}'); if (Err = ERR_INVALID_HANDLE ) then Result := ExpandConstant('{cm:ErrInvalidHandle}'); if (Err = ERR_BUFFER_TOO_SMALL ) then Result := ExpandConstant('{cm:ErrBufferTooSmall}'); if (Err = ERR_VALUE_NOT_FOUND ) then Result := ExpandConstant('{cm:ErrValueNotFound}'); if (Err = ERR_INVALID_CREATOR_ID ) then Result := ExpandConstant('{cm:ErrInvalidCreatorId}'); if (Err = ERR_INVALID_POINTER ) then Result := ExpandConstant('{cm:ErrInvalidPointer}'); if (Err = ERR_UNABLE_TO_INSTALL_OLD ) then Result := ExpandConstant('{cm:ErrUnableToInstallOld}'); if (Err = ERR_INVALID_CONDUIT_TYPE ) then Result := ExpandConstant('{cm:ErrInvalidConduitType}'); if (Err = ERR_INVALID_COM_PORT_TYPE ) then Result := ExpandConstant('{cm:ErrInvalidCOMPortType}'); if (Err = ERR_NO_LONGER_SUPPORTED ) then Result := ExpandConstant('{cm:ErrNoLongerSupported}'); if (Err = ERR_INVALID_PATH ) then Result := ExpandConstant('{cm:ErrInvalidPath}'); if (Err = ERR_ALREADY_INSTALLED ) then Result := ExpandConstant('{cm:ErrAlreadyInstalled}'); if (Err = ERR_STORAGE_ACCESS ) then Result := ExpandConstant('{cm:ErrStorageAccess}'); if (Err = ERR_NOTIFIER_NOT_FOUND ) then Result := ExpandConstant('{cm:ErrNotifierNotFound}'); if (Err = ERR_INSTALL_ID_ALREADY_IN_USE ) then Result := ExpandConstant('{cm:ErrInstallIdAlreadyInUse}'); if (Err = ERR_INVALID_INSTALL_ID ) then Result := ExpandConstant('{cm:ErrInvalidInstallId}'); { HotSync Manager Errors } if (Err = ERROR_HSAPI_HOTSYNC_NOT_FOUND ) then Result := ExpandConstant('{cm:ErrorHsapiHotSyncNotFound}'); if (Err = ERROR_HSAPI_INVALID_CONN_TYPE ) then Result := ExpandConstant('{cm:ErrorHsapiInvalidConnType}'); if (Err = ERROR_HSAPI_FAILURE ) then Result := ExpandConstant('{cm:ErrorHsapiFailure}'); if (Err = ERROR_HSAPI_REG_FAILURE ) then Result := ExpandConstant('{cm:ErrorHsapiRegFailure}'); if (Err = ERROR_HSAPI_UNKNOWN_STATUS_TYPE) then Result := ExpandConstant('{cm:ErrorHsapiUnknownStatusType}'); if (Err = ERROR_HSAPI_UNABLE_TO_CLOSE ) then Result := ExpandConstant('{cm:ErrorHsapiUnableToClose}'); if (Err = ERROR_HSAPI_NO_HOTSYNC_PATH ) then Result := ExpandConstant('{cm:ErrorHsapiNoHotSyncPath}'); if (Err = ERROR_HSAPI_UNABLE_TO_START ) then Result := ExpandConstant('{cm:ErrorHsapiUnableToStart}'); if (Err = ERROR_HSAPI_INVALID_STATUS_FLAG) then Result := ExpandConstant('{cm:ErrorHsapiInvalidStatusFlag}'); if (Err = ERROR_HSAPI_INVALID_POINTER ) then Result := ExpandConstant('{cm:ErrorHsapiInvalidPointer}'); { Install Aide Errors } if (Err = ERR_PILOT_NO_USERS ) then Result := ExpandConstant('{cm:ErrPilotNoUsers}'); if (Err = ERR_PILOT_INVALID_USER_INDEX ) then Result := ExpandConstant('{cm:ErrPilotInvalidUserIndex}'); if (Err = ERR_PILOT_BUFSIZE_TOO_SMALL ) then Result := ExpandConstant('{cm:ErrPilotBufsizeTooSmall}'); if (Err = ERR_PILOT_NO_USERSDAT_FILE ) then Result := ExpandConstant('{cm:ErrPilotNoUsersDatFile}'); if (Err = ERR_PILOT_COPY_FAILED ) then Result := ExpandConstant('{cm:ErrPilotCopyFailed}'); if (Err = ERR_IA_INVALID_USER ) then Result := ExpandConstant('{cm:ErrIaInvalidUser}'); if (Err = ERR_PILOT_INVALID_USER ) then Result := ExpandConstant('{cm:ErrPilotInvalidUser}'); if (Err = ERR_PILOT_INVALID_FILENAME ) then Result := ExpandConstant('{cm:ErrPilotInvalidFilename}'); if (Err = ERR_PILOT_INVALID_FILE_INDEX ) then Result := ExpandConstant('{cm:ErrPilotInvalidFileIndex}'); if (Err = ERR_PILOT_USERSDAT_ALREADY_EXISTS ) then Result := ExpandConstant('{cm:ErrPilotUsersDatAlreadyExists}'); if (Err = ERR_PILOT_INVALID_PATH_TYPE ) then Result := ExpandConstant('{cm:ErrPilotInvalidPathType}'); if (Err = ERR_PILOT_INVALID_REGISTRY ) then Result := ExpandConstant('{cm:ErrPilotInvalidRegistry}'); if (Err = ERR_PILOT_INVALID_PATH ) then Result := ExpandConstant('{cm:ErrPilotInvalidPath}'); if (Err = ERR_PILOT_FILE_ALREADY_EXISTS ) then Result := ExpandConstant('{cm:ErrPilotFileAlreadyExists}'); if (Err = ERR_PILOT_INVALID_SOURCE_FILE ) then Result := ExpandConstant('{cm:ErrPilotInvalidSourceFile}'); if (Err = ERR_PILOT_INVALID_INDEX ) then Result := ExpandConstant('{cm:ErrPilotInvalidIndex}'); if (Err = ERR_PILOT_INVALID_FILE_TYPE ) then Result := ExpandConstant('{cm:ErrPilotInvalidFileType}'); if (Err = ERR_PILOT_INVALID_BUFFER ) then Result := ExpandConstant('{cm:ErrPilotInvalidBuffer}'); if (Err = ERR_PILOT_INVALID_CREATORID ) then Result := ExpandConstant('{cm:ErrPilotInvalidCreatorId}'); if (Err = ERR_PALM_NO_CORE_PATH ) then Result := ExpandConstant('{cm:ErrPalmNoCorePath}'); if (Err = ERR_PALM_UNABLE_TO_CREATE_NEW_FILE ) then Result := ExpandConstant('{cm:ErrPalmUnableToCreateNewFile}'); if (Err = ERR_PALM_SEMAPHORE_ACCESS ) then Result := ExpandConstant('{cm:ErrPalmSemaphoreAccess}'); if (Err = ERR_PALM_OTHER_USERSDAT_ACCESS_PROBLEM) then Result := ExpandConstant('{cm:ErrPalmOtherUsersDatAccessProblem}'); if (Err = ERR_IA_INVALID_USER_ID ) then Result := ExpandConstant('{cm:ErrIaInvalidUserId}'); if (Err = ERR_PALM_FILE_DELETE_FAILED ) then Result := ExpandConstant('{cm:ErrPalmFileDeleteFailed}'); if (Err = ERR_PALM_FILE_MOVE_FAILED ) then Result := ExpandConstant('{cm:ErrPalmFileMoveFailed}'); if (Err = ERR_PALM_NO_DIRECTORY ) then Result := ExpandConstant('{cm:ErrPalmNoDirectory}'); if (Err = ERR_PALM_NO_USER_FILE ) then Result := ExpandConstant('{cm:ErrPalmNoUserFile}'); if (Err = ERR_PALM_NO_USERS ) then Result := ExpandConstant('{cm:ErrPalmNoUsers}'); if (Err = ERR_PALM_NOT_FOUND ) then Result := ExpandConstant('{cm:ErrPalmNotFound}'); if (Err = ERR_PALM_BAD_FILENAME ) then Result := ExpandConstant('{cm:ErrPalmBadFilename}'); if (Err = ERR_PALM_USER_ACCESS ) then Result := ExpandConstant('{cm:ErrPalmUserAccess}'); if (Err = ERR_IA_INVALID_FILE_TYPE ) then Result := ExpandConstant('{cm:ErrIaInvalidFileType}'); end; function PalmInstallConduit(CreatorID: String; cType: Integer; Name, Directory, Filename, Remote, Title: String; Priority: Integer): Integer; var err: Integer; begin err := CmInstallCreator(CreatorID, cType); if (err = ERR_NONE) then err := CmSetCreatorName(CreatorID, Name); if (err = ERR_NONE) and (Directory <> '') then err := CmSetCreatorDirectory(CreatorID, Directory); if (err = ERR_NONE) and (Filename <> '') then err := CmSetCreatorFile(CreatorID, Filename); if (err = ERR_NONE) and (Remote <> '') then err := CmSetCreatorRemote(CreatorID, Remote); if (err = ERR_NONE) and (Title <> '') then err := CmSetCreatorTitle(CreatorID, Title); if (err = ERR_NONE) then err := CmSetCreatorPriority(CreatorID, Priority); Log('Installing "' + Title + '" conduit (' + CreatorID + ') "' + Name + '" "' + Directory + '" "' + Filename + '":' + PalmGetErrorMessage(err)); Result := err; end; function PalmInstallJavaConduit(CreatorID: String; cType: Integer; ClassName, ClassPath, Directory, Filename, Remote, Title: String; Priority: Integer): Integer; var err: Integer; begin err := PalmInstallConduit(CreatorID, cType, 'jsync13.dll', Directory, Filename, Remote, Title, Priority); if (err = ERR_NONE) then err := CmSetCreatorValueString(CreatorID, 'ClassName', ClassName); if (err = ERR_NONE) then err := CmSetCreatorValueString(CreatorID, 'ClassPath13', ClassPath); Log('..Java conduit settings:' + PalmGetErrorMessage(err)); Result := err; end; function PalmInstallCOMConduit(CreatorID: String; cType: Integer; COMClient, Directory, Filename, Remote, Title: String; Priority: Integer): Integer; var err: Integer; begin err := PalmInstallConduit(CreatorID, cType, 'COMConduit.dll', Directory, Filename, Remote, Title, Priority); if (err = ERR_NONE) then err := CmSetCreatorValueString(CreatorID, 'COMClient', COMClient); Log('..COM conduit settings:' + PalmGetErrorMessage(err)); Result := err; end; procedure PalmUninstallConduit(CreatorID: String); begin { Uninstall the conduit } CmRemoveConduitByCreatorID(CreatorID); end; { * * * * * * * * * * * * * * * * * * * * * * * * Palm HotSync Dir for "code:" variable * * * * * * * * * * * * * * * * * * * * * * * * } function PalmHotSyncDir(Param: String): String; var path: String; begin CmGetHotSyncExecPath(path); Result := ExtractFileDir(path); end; { * * * * * * * * * * * * * * * * * Wizard Helper Functions * * * * * * * * * * * * * * * * * } { Checks for HotSync installation. Call from InitializeSetup. } function PalmInitializeSetup(): Boolean; var path: String; err: Integer; begin PalmUserPage := nil; err := CmGetHotSyncExecPath(path); if (err = ERR_NONE) and (Length(path) = 0) then err := ERR_CONDUIT_MGR; Log('Get HotSync Path:' + PalmGetErrorMessage(err)); Result := (err = ERR_NONE); if not Result then MsgBox(ExpandConstant('{cm:PalmNoHotSync}'), mbError, MB_OK); end; { Creates the Palm user selection wizard page. Call from InitializeWizard. } procedure PalmInitializeWizard(const AfterID: Integer); var PalmUsers: TArrayOfString; idx: Integer; begin PalmUsers := PltGetUsers(); if GetArrayLength(PalmUsers) > 0 then begin PalmUserPage := CreateInputOptionPage(AfterID, ExpandConstant('{cm:PalmSelectUsers}'), ExpandConstant('{cm:PalmWhichUsers}'), ExpandConstant('{cm:PalmSelectUsersNext}'), False, True); for idx := 0 to GetArrayLength(PalmUsers) - 1 do begin PalmUserPage.Add(PalmUsers[idx]); PalmUserPage.Values[idx] := True; end; end; end; procedure PalmCurStepChanged(CurStep: TSetupStep); var err: Longint; begin if CurStep = ssInstall then begin err := HsSetAppStatus(HsCloseApp, HSFLAG_NONE); Log('Close HotSync:' + PalmGetErrorMessage(err)); end; if CurStep = ssPostInstall then begin err := HsSetAppStatus(HsStartApp, HSFLAG_NONE); Log('Start HotSync:' + PalmGetErrorMessage(err)); end; end; { Calls PltInstallFile for each selected Palm user. } procedure PalmInstallApplication(Filename: String); var idx: Integer; err: Integer; User: String; begin if PalmUserPage <> nil then begin { Install the given Palm application for selected users } Log('Installing Palm application "' + Filename + '" for user(s):'); for idx := 0 to PalmUserPage.CheckListBox.ITEMS.Count - 1 do begin if PalmUserPage.Values[idx] then begin User := PalmUserPage.CheckListBox.ITEMS.Strings[idx]; err := PltInstallFile(User, Filename); Log(' ' + User); end; end; Log('Install complete.'); end; end; function PalmInitializeUninstall(): Boolean; begin Result := True; end; procedure PalmUninstallStepChanged(CurUninstallStep: TUninstallStep); begin if CurUninstallStep = usUninstall then begin HsRefreshConduitInfo(); { Release DLLs so they can be deleted } UnloadDLL(ExpandConstant('{app}\instaide.dll')); UnloadDLL(ExpandConstant('{app}\hsapi.dll')); UnloadDLL(ExpandConstant('{app}\condmgr.dll')); end; end;