Use Windows.pkg Use DFClient.pkg Use cForm.pkg Use RegCheck2.pkg Activate_View Activate_oRegCheck2_View for oRegCheck2_View Object oRegCheck2_View is a dbView Set Border_Style to Border_Thick Set Size to 316 493 Set Location to 0 -1 Set Label to "RegCheck2 Test View" Set Maximize_Icon to True Set View_Mode to Viewmode_Zoom Object oInfo_3d is a Container3d Set Size to 46 475 Set Location to 7 9 Set Color to clWhite Set Border_Style to Border_Normal Object oInfo_tb is a TextBox Set Auto_Size_State to False Set Size to 39 468 Set Location to 3 3 Set Label to "NOTE: This is info about the current machine and the program is not intended to be run at customer site. Instead, make changes to the ghoRegCheck2 object and put a Use RegCheck2.pkg in your source program to make these checks each time your program is started. Do not make changes to the objects here, it will do nothing. However, you can click the 'Make Registry Changes' button to make registry changes now. Tip: Hover the mouse over an item to read its tooltip text." Set Color to clWhite Set Justification_Mode to JMode_Left End_Object End_Object Object oRunChangeProgram_btn is a Button Set Size to 25 79 Set Location to 278 406 Set Label to "Make Registry Changes Now!" Set psToolTip to "Run the change program that performs registry changes. It is only necessary to do so if the 'Registry Changes Needed' checkbox is checked and has a RED background. Else the Change Program will inform you that no changes are needed." Set peAnchors to anNone Set MultiLineState to True Procedure OnClick Integer iRetval String sPath sProgram Move CS_RegChangeProgram to sProgram Get psProgramPath of (phoWorkspace(ghoApplication)) to sPath Get PathAtIndex of (phoWorkspace(ghoApplication)) sPath 1 to sPath Move (sPath - "\" - sProgram) to sProgram // The shell option was introduced with VDF 14. #IF (FMAC_VERSION < 14) Runprogram Background sProgram #ELSE Runprogram Shell Background sProgram #ENDIF Get YesNo_Box ("Has the" * CS_RegChangeProgram * "program changed the registry?") to iRetval If (iRetval = MBR_Yes) Begin Send RetrieveOSInfo Send DoFillList of oList End End_Procedure End_Object Object oVersionInfo_grp is a Group Set Size to 116 304 Set Location to 57 9 Set Label to "Operative System Properties" Set peAnchors to anNone Object oWindowsVersion is a cForm Set Size to 13 231 Set Location to 11 66 Set Label to "Windows Version" Set psToolTip to "Full Windows version description" Set peAnchors to anTopLeftRight End_Object Object oVersionNumber is a cForm Set Size to 13 231 Set Location to 26 66 Set Label to "Version Number" Set psToolTip to "piMajorVersion and piMinorVersion" Set peAnchors to anTopLeftRight End_Object Object oEdition is a cForm Set Size to 13 231 Set Location to 41 66 Set Label to "Edition" Set psToolTip to "The Edition string contains specific details about the platform that cannot be enabled as a role. So 'Home' edition or 'Datacenter' edition are good examples." Set peAnchors to anTopLeftRight End_Object Object oBuildNumber is a cForm Set Size to 13 231 Set Location to 56 66 Set Label to "Build Number" Set psToolTip to "Identifies the build number of the operating system" Set peAnchors to anTopLeftRight End_Object Object oServicePack is a cForm Set Size to 13 96 Set Location to 71 66 Set Label to "Service Pack" Set psToolTip to "Identifies the major version number of the latest Service Pack installed on the system. For example, for Service Pack 3, the major version number is 3. If no Service Pack has been installed, the value is zero. If this is lower than the Min service pack to the right it will have a RED background - meaning it needs to be updated." Set peAnchors to anNone End_Object Object oMinServicePack is a cForm Set Size to 13 59 Set Location to 71 238 Set Label to "Min Service Pack" Set psToolTip to "piMinxxx_ServicePack. The minimum service pack that is required for the current windows version. If it is higher than the actual 'Service Pack' version to the left AND pbTestServicePack = True, user will get informed that a newer service pack needs to be installed before the program can run." Set peAnchors to anTopLeftRight End_Object Object oFeatures is a cForm Set Size to 13 231 Set Location to 86 66 Set Label to "Features" Set psToolTip to "The psSuite string only contains features which can be enabled or not, so it is NOT a direct mapping to piSuiteMask. An example of this is if you are in a remote desktop session or not." Set peAnchors to anTopLeftRight End_Object Object oX64OS is a CheckBox Set Size to 13 230 Set Location to 102 66 Set Label to "X64 version" Set psToolTip to "pbX64 is set to true if your host OS is x64 (64-bits)" End_Object Object oNTServer is a CheckBox Set Size to 13 230 Set Location to 102 157 Set Label to "Windows Server" Set psToolTip to "Running windows version is a server version." End_Object Object oWindowsHome is a CheckBox Set Size to 13 230 Set Location to 102 237 Set Label to "Windows Home" Set psToolTip to "The Windows HOME version is NOT a recommended platform for running business applications (networking is limited)." End_Object End_Object Object oComputerAndUserInfo_grp is a Group Set Size to 44 304 Set Location to 176 9 Set peAnchors to anNone Set Label to "Computer and User Info" Object oComputerName is a cForm Set Size to 13 231 Set Location to 10 66 Set Label to "Computer Name" Set peAnchors to anTopLeftRight End_Object Object oUserLoginName is a cForm Set Size to 13 231 Set Location to 25 66 Set Label to "User Login Name" Set psToolTip to "The user network login name" Set peAnchors to anTopLeftRight End_Object End_Object Object oOtherClassProperties_grp is a Group Set Size to 50 304 Set Location to 223 9 Set peAnchors to anNone Set Label to "cRegCheck2 Class Properties Set in the ghoRegCheck2 Object" Object oBruteForce is a CheckBox Set Size to 13 230 Set Location to 10 66 Set Label to "Driver Brute Force" Set psToolTip to "pbDriverBruteForce. To force a change of the registry even if there are more than the 'DATAFLEX' database driver loaded. It is possible that an (accounting) Pervasive table gets queried for info while the rest of the tables are in the embedded DataFlex database." End_Object Object oReportStateOnly is a CheckBox Set Size to 13 230 Set Location to 10 157 Set Label to "Report State Only" Set psToolTip to "pbReportStateOnly. Set to true if you only want to report current registry settings - but not try to change them." End_Object Object oAdminRights is a CheckBox Set Size to 13 230 Set Location to 10 237 Set Label to "Admin Rights" Set psToolTip to "pbAdminRights. Is the program run with administrator rights?" End_Object Object oHighDataIntegrity is a CheckBox Set Size to 13 230 Set Location to 22 66 Set Label to "High Data Integrity" Set psToolTip to "pbChangeHighDataIntegrity. If True the DF_HIGH_DATA_INTEGRITY will be set to True. If false the DF_HIGH_DATA_INTEGRITY is not changed." End_Object Object oTestServicePack is a CheckBox Set Size to 13 230 Set Location to 22 157 Set Label to "Test Service Pack" Set psToolTip to "pbTestServicePack. Should we check for the service pack and if it is to low deny the running of the application?" End_Object Object oSilentMode is a CheckBox Set Size to 13 230 Set Location to 22 237 Set Label to "Silent Mode" Set psToolTip to "pbSilentMode. Ask user before making changes?" End_Object Object oDoServerRegistryChanges is a CheckBox Set Size to 13 230 Set Location to 35 66 Set Label to "Do Server Changes" Set psToolTip to "pbDoServerRegistryChanges. Make Server registry changes on all machines? A machine might be used both as a client and a server, so it safest to always make registry changes as if the machine is a server. It won't affect performance if the machine is not used as a server machine." End_Object End_Object // Note: Object needs to be after the oRunChangeProgram_btn object. Object oImportantClassProperties_grp is a Group Set Size to 50 162 Set Location to 223 322 Set Label to "Important RegCheck2 Class Properties" Set peAnchors to anNone Object oRegistryChangesNeeded is a CheckBox Set Size to 13 230 Set Location to 10 6 Set Label to "Registry Changes Needed" Set psToolTip to "pbRegistryChangesNeeded. This property is set to true when at least one registry change is needed. Registry changes can be done by clicking the 'Make Registry Changes' button." Procedure OnChange Boolean bState Get Checked_State to bState Set Color to (If(bState = True, clRed, clLime)) End_Procedure End_Object Object oServicePackUpdateNeeded is a CheckBox Set Size to 13 230 Set Location to 22 6 Set Label to "Service Pack Updates Needed" Set psToolTip to "pbServicePackUpdateNeeded. New Service Pack(s) needs to be installed." Procedure OnChange Boolean bState Get Checked_State to bState Set Color to (If(bState = True, clRed, clLime)) End_Procedure End_Object End_Object Object oRegChangesToDo_grp is a Group Set Size to 163 162 Set Location to 57 322 Set Label to "ptRegChangesToDo Property Values" Object oGridInfo_tb is a TextBox Set Size to 10 32 Set Location to 12 8 Set Label to "Red = Registry Change Needed. Green = OK" Set psToolTip to "The values of the ptRegChangesToDo (struct) property is set by the messages; 'DoCheckClientRegistrySettings', 'DoCheckServerRegistrySettings' and 'DoWriteRegistrySettings' The property holds booleans; one for each of the registry keys that is checked." End_Object Object oList is a Grid Set Size to 132 150 Set Location to 26 6 Set Header_Visible_State to False Set Line_Width to 1 0 Set Form_Width 0 to 147 // The code should work with VDF 11 and later. Thus // CodeJock controls cannot be used. Procedure DoFillList tRegChangesToDo RegChangesToDo Boolean bState Get ptRegChangesToDo of ghoRegCheck2 to RegChangesToDo Send Delete_Data Send Add_Item Msg_None "Client Settings:" Send Add_Item Msg_None CS_OplocksDisabled Move RegChangesToDo.bOplocksDisabled to bState Set ItemColor (Item_Count(Self) -1) to (If(bState = True, clRed, clLime)) Set Entry_State item (Item_Count(Self) -1) to False Send Add_Item Msg_None CS_UseOpportunisticLocking Move RegChangesToDo.bUseOpportunisticLocking to bState Set ItemColor (Item_Count(Self) -1) to (If(bState = True, clRed, clLime)) Set Entry_State item (Item_Count(Self) -1) to False Send Add_Item Msg_None CS_DirectoryCacheLifetime Move RegChangesToDo.bDirectoryCacheLifetime to bState Set ItemColor (Item_Count(Self) -1) to (If(bState = True, clRed, clLime)) Set Entry_State item (Item_Count(Self) -1) to False Send Add_Item Msg_None CS_FileNotFoundCacheLifetime Move RegChangesToDo.bFileInfoCacheLifetime to bState Set ItemColor (Item_Count(Self) -1) to (If(bState = True, clRed, clLime)) Set Entry_State item (Item_Count(Self) -1) to False Send Add_Item Msg_None CS_FileInfoCacheLifetime Move RegChangesToDo.bFileNotFoundCacheLifetime to bState Set ItemColor (Item_Count(Self) -1) to (If(bState = True, clRed, clLime)) Set Entry_State item (Item_Count(Self) -1) to False Send Add_Item Msg_None "Server Settings:" Send Add_Item Msg_None CS_EnableOplocks Move RegChangesToDo.bEnableOplocks to bState Set ItemColor (Item_Count(Self) -1) to (If(bState = True, clRed, clLime)) Set Entry_State item (Item_Count(Self) -1) to False Send Add_Item Msg_None CS_SMB2 Move RegChangesToDo.bSMB2 to bState Set ItemColor (Item_Count(Self) -1) to (If(bState = True, clRed, clLime)) Set Entry_State item (Item_Count(Self) -1) to False Send Add_Item Msg_None CS_SMB3 Move RegChangesToDo.bSMB3 to bState Set ItemColor (Item_Count(Self) -1) to (If(bState = True, clRed, clLime)) Set Entry_State item (Item_Count(Self) -1) to False End_Procedure Procedure Set Select_State Integer iItem Integer bSelect End_Procedure End_Object End_Object Procedure RetrieveOSInfo Boolean bState String sValue Integer iMajor iMinor iMinServicePack iCurrentMinServicePack // We just want to report the state of this // machine - not make any suggested changes. Get pbReportOnlyState of ghoRegCheck2 to bState Set pbReportOnlyState of ghoRegCheck2 to True Send DoCheckRegistrySettings of ghoRegCheck2 Set pbReportOnlyState of ghoRegCheck2 to bState // Get OS version info: Get psOSVersion of ghoRegCheck2 to sValue Set Value of oWindowsVersion to sValue Get piMajorVersion of ghoRegCheck2 to iMajor Get piMinorVersion of ghoRegCheck2 to iMinor Set Value of oVersionNumber to (String(iMajor) + "." + String(iMinor)) Get piBuildNumber of ghoRegCheck2 to sValue Set Value of oBuildNumber to sValue Get psEdition of ghoRegCheck2 to sValue Set Value of oEdition to sValue Get psCSDVersion of ghoRegCheck2 to sValue Set Value of oServicePack to sValue Get piServicePackMajor of ghoRegCheck2 to iMinServicePack Get CurrentMinServicePack of ghoRegCheck2 to iCurrentMinServicePack Set Color of oServicePack to (If(iMinServicePack < iCurrentMinServicePack, clRed, clLime)) Set Value of oMinServicePack to (String(iCurrentMinServicePack)) Get psSuite of ghoRegCheck2 to sValue Set Value of oFeatures to sValue Get pbX64 of ghoRegCheck2 to bState Set Checked_State of oX64OS to bState Get pbWindowsHome of ghoRegCheck2 to bState Set Checked_State of oWindowsHome to bState Get pbNTServer of ghoRegCheck2 to bState Set Checked_State of oNTServer to bState Get psComputerName of ghoRegCheck2 to sValue Set Value of oComputerName to sValue Get psUserLoginName of ghoRegCheck2 to sValue Set Value of oUserLoginName to sValue Get pbDriverBruteForce of ghoRegCheck2 to bState Set Checked_State of oBruteForce to bState Get pbReportOnlyState of ghoRegCheck2 to bState Set Checked_State of oReportStateOnly to bState Get pbAdminRights of ghoRegCheck2 to bState Set Checked_State of oAdminRights to bState Get pbChangeHighDataIntegrity of ghoRegCheck2 to bState Set Checked_State of oHighDataIntegrity to bState Get pbSilentMode of ghoRegCheck2 to bState Set Checked_State of oSilentMode to bState Get pbDoServerRegistryChanges of ghoRegCheck2 to bState Set Checked_State of oDoServerRegistryChanges to bState Get pbTestServicePack of ghoRegCheck2 to bState Set Checked_State of oTestServicePack to bState Get pbRegistryChangesNeeded of ghoRegCheck2 to bState Set Checked_State of oRegistryChangesNeeded to bState Get pbServicePackUpdateNeeded of ghoRegCheck2 to bState Set Checked_State of oServicePackUpdateNeeded to bState End_Procedure Procedure Activating Returns Integer Integer iRetVal Forward Get msg_activating to iRetval If (iRetval=0) Begin Send RetrieveOSInfo Send DoFillList of oList End Procedure_Return iRetval End_Procedure Object oHelp_btn is a Button Set Size to 14 50 Set Location to 288 8 Set Label to "Help" Set psToolTip to "Help about the cRegCheck2 class (F1)" Set peAnchors to anNone Procedure OnClick String sPath Get psHelpPath of (phoWorkspace(ghoApplication)) to sPath Get PathAtIndex of (phoWorkspace(ghoApplication)) sPath 1 to sPath #IF (FMAC_VERSION < 14) Runprogram Background (sPath - "\" - CS_RegCheck2HelpFile) #ELSE Runprogram Shell Background (sPath - "\" - CS_RegCheck2HelpFile) #ENDIF End_Procedure End_Object Object oAbout_btn is a Button Set Size to 14 50 Set Location to 288 63 Set Label to "About" Set psToolTip to "Info about the program" Set peAnchors to anNone Procedure OnClick Send Activate_About End_Procedure End_Object Object oViewLogFile_btn is a Button Set Size to 14 50 Set Location to 288 118 Set Label to "View Logfile" Set psToolTip to ("Open the logfile (" - CS_LogFileName - ") with the Windows associated program.") Set peAnchors to anNone Procedure OnClick String sPath Get psDataPath of (phoWorkspace(ghoApplication)) to sPath Get PathAtIndex of (phoWorkspace(ghoApplication)) sPath 1 to sPath #IF (FMAC_VERSION < 14) Runprogram Background (sPath - "\" - CS_LogFileName) #ELSE Runprogram Shell Background (sPath - "\" - CS_LogFileName) #ENDIF End_Procedure End_Object Object oResetRegistryValues_btn is a Button Set Size to 14 79 Set Location to 289 235 Set Label to "Reset Registry Values" Set psToolTip to "WARNING! Run the change program in revers. It will run the Change Program with a parameter to tell it to reset all registry values to their Windows default values." Set peAnchors to anNone Procedure OnClick Integer iRetval String sPath sProgram Move CS_RegChangeProgram to sProgram Get Message_Box "This will reset all registry values to their DEFAULT values as defined by Windows. Do NOT run this if you are going to use the DataFlex embedded database on this machine. Are you sure you want to do that?" "Warning" MB_YESNO (MB_ICONWARNING ior MB_DEFBUTTON2) to iRetval If (iRetval <> MBR_Yes) Begin Procedure_Return End Get psProgramPath of (phoWorkspace(ghoApplication)) to sPath Get PathAtIndex of (phoWorkspace(ghoApplication)) sPath 1 to sPath // The shell option was introduced with VDF 14. #IF (FMAC_VERSION < 14) Runprogram Background (sPath - "\" - sProgram) CS_DefaultRegSettings #ELSE Runprogram Shell Background (sPath - "\" - sProgram) CS_DefaultRegSettings #ENDIF Get YesNo_Box ("Has the" * CS_RegChangeProgram * "program changed the registry?") to iRetval If (iRetval = MBR_Yes) Begin Send RetrieveOSInfo Send DoFillList of oList End End_Procedure End_Object Object oRunWindowsUpdate_btn is a Button Set Size to 14 79 Set Location to 289 321 Set Label to "Run Windows Update" Set psToolTip to "Run Windows Update. It is only necessary to do so if the 'Service Pack Update Needed' checkbox is checked and has a RED background." Set peAnchors to anNone Procedure OnClick Runprogram Background CS_WindowsUpdate End_Procedure End_Object End_Object