![]() ![]() Never change the ACLs on a top-level key like HKEY_LOCAL_MACHINE\SOFTWARE, otherwise you can open up security holes on your users' systems. This parameter should only be used on registry keys private to your application. In the event these conditions are not met, no error message will be displayed, and the permissions will not be set. ![]() It is not recommended that you use this parameter if you aren't familiar with ACLs or why you would need to change them, because misusing it could negatively impact system security.įor this parameter to have an effect the current user must be able to change the permissions on the registry key. Specifies additional permissions to grant in the registry key's ACL (access control list). On a string, expandsz, or multisz type value, you may use a special constant called in this parameter to embed line breaks (nulls). If the data type is none, this is ignored. If the data type is binary, this is a sequence of hexadecimal bytes in the form: "00 ff 12 34". "$7B"), or a constant which resolves to an integer. If the data type is dword or qword, this can be a decimal integer (e.g. If the ValueType parameter is string, expandsz, or multisz, this is a string that can include constants. I believe my code is simpler and make full use of existing information in your registry.The data for the value. however, that approach is a complicated approach. Pascal programming has become part of my life.Īctually I tried to search on Google before actions, and the only useful entry returned from query is a post on AgileTrack Blog. In fact, I prefer Pascal script to MSIcode in InstallAware and I will continue using Inno Setup for CBC. Once I find a way to do so, those hard coded strings can be replaced. Currently, I do not know how to access AppID of section in section, so all version strings are hard coded. These function should be placed at the beginning of section. This is an important thing, that you can debug the code in Delphi while you cannot debug it in Inno Setup,įunction GetNumber ( var temp : String ): Integer var part : String pos1 : Integer begin if Length ( temp ) = 0 then begin Result := - 1 Exit end pos1 := Pos ( '.', temp ) if ( pos1 = 0 ) then begin Result := StrToInt ( temp ) temp := '' end else begin part := Copy ( temp, 1, pos1 - 1 ) temp := Copy ( temp, pos1 + 1, Length ( temp )) Result := StrToInt ( part ) end end function CompareInner ( var temp1, temp2 : String ): Integer var num1, num2 : Integer begin num1 := GetNumber ( temp1 ) num2 := GetNumber ( temp2 ) if ( num1 = - 1 ) or ( num2 = - 1 ) then begin Result := 0 Exit end if ( num1 > num2 ) then begin Result := 1 end else if ( num1 < num2 ) then begin Result := - 1 end else begin Result := CompareInner ( temp1, temp2 ) end end function CompareVersion ( str1, str2 : String ): Integer var temp1, temp2 : String begin temp1 := str1 temp2 := str2 Result := CompareInner ( temp1, temp2 ) end If an older version is there, uninstall it and continue to install this new version.īecause Inno Setup does not provide version string comparison function, I wrote customized code first in Delphi 2007 and then copied the code to Inno Setup script. Then, I compare the read result with current version, 6.įinally, if there is a newer or the same version installed, exit. Second, I read AppVersion from registry named DisplayVersion. This installer will exit.', mbInformation, MB_OK ) Result := False end end else begin Result := True end end ĭo something in InitializeSetup gives you a chance to exit the installation if necessary.įirst, I try to see if CBC was installed. Function InitializeSetup (): Boolean var oldVersion : String uninstaller : String ErrorCode : Integer begin if RegKeyExists ( HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\_is1', 'UninstallString', uninstaller ) ShellExec ( 'runas', uninstaller, '/SILENT', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode ) Result := True end end else begin MsgBox ( 'Version ' + oldVersion + ' of Code Beautifier Collection is already installed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |