begin Options := CnOtaGetActiveProjectOptions(nil); if Options = nil then Exit; Project := CnOtaGetCurrentProject; if Project = nil then Exit;
if (Compiler = cnDelphi5) or (Compiler = cnBCB5) then begin if not QueryDlg('This function maybe can NOT run correctly in Delphi 5 or C++Builder 5 for an OTA Bug.' + #13#10#13#10 + 'Do you want to Continue?', False) then Exit; end;
// Get the Versions MajorVer := Options.GetOptionValue('MajorVersion'); MinorVer := Options.GetOptionValue('MinorVersion'); ReleaseNo := Options.GetOptionValue('Release'); BuildNo := Options.GetOptionValue('Build');
if QueryDlg(Format('Current Project Version is %d.%d.%d.%d. Inc the Build Number?', [MajorVer, MinorVer, ReleaseNo, BuildNo]), False) then begin
// Note: In Delphi 5/C++Builder 5, there's a BUG. // Nubers are correct here, but maybe unchanged in Project Options Dialog. InfoDlg(Format('Current Project Version is %d.%d.%d.%d.', [MajorVer, MinorVer, ReleaseNo, BuildNo])); end;
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ToolsAPI, CnCommon, CnWizUtils; var Options: IOTAProjectOptions; Project: IOTAProject; BuildNo: Integer; Year, Month, Day:Word; begin Options := CnOtaGetActiveProjectOptions(nil); if Options = nil then Exit; Project := CnOtaGetCurrentProject; if Project = nil then Exit;
if (Compiler = cnDelphi5) or (Compiler = cnBCB5) then begin if not QueryDlg('This function maybe can NOT run correctly in Delphi 5 or C++Builder 5 for an OTA Bug.' + #13#10#13#10 + 'Do you want to Continue?', False) then Exit; end;
// Note: In Delphi 5/C++Builder 5, there's a BUG. // Nubers are correct here, but maybe unchanged in Project Options Dialog. InfoDlg(Format('Current Project Version is %d.%d.%d.%d.', [Year, Month, Day, BuildNo])); end;
begin Options := CnOtaGetActiveProjectOptions(nil); if Options = nil then Exit; Project := CnOtaGetCurrentProject; if Project = nil then Exit;
if (Compiler = cnDelphi5) or (Compiler = cnBCB5) then begin if not QueryDlg('This function maybe can NOT run correctly in Delphi 5 or C++Builder 5 for an OTA Bug.' + #13#10#13#10 + 'Do you want to Continue?', False) then Exit; end;
// Note: In Delphi 5/C++Builder 5, there's a BUG. // Nubers are correct here, but maybe unchanged in Project Options Dialog. InfoDlg(Format('Current Project Version is %d.%d.%d.%d.', [MajorVer, MinorVer, ReleaseNo, BuildNo])); end;
可能和cnpack版本有关,如果出现下面的对话框,IDE版本识别错了,就无法写入版本信息了。 if (Compiler = cnDelphi5) or (Compiler = cnBCB5) then begin if not QueryDlg('This function maybe can NOT run correctly in Delphi 5 or C++Builder 5 for an OTA Bug.' + #13#10#13#10 + 'Do you want to Continue?', False) then Exit; end;
----------------------------------------------
Delphi4Linux Delphi三层/FireDAC 技术群:734515869 http://www.cnblogs.com/rtcmw
conditional defines add IS_MASTER build cnpackide dll copy dll in reg dir Test delphi 2007 up4 dec and cnpack ide 0.9.7.595 src ok
----------------------------------------------
[alias] co = clone --recurse-submodules up = submodule update --init --recursiveupd = pullinfo = statusrest = reset --hard懒鬼提速https://www.cctry.com/>http://qalculate.github.io/downloads.htmlhttps://www.cctry.com/
var Options: IOTAProjectOptions; Project: IOTAProject; MajorVer, MinorVer, ReleaseNo, BuildNo: Integer; T:TOTAOptionNameArray; i:integer; Lineas: TStringList; begin Lineas:= TStringList.Create; Options := CnOtaGetActiveProjectOptions(nil); if Options = nil then Exit; Project := CnOtaGetCurrentProject; if Project = nil then Exit;
if (Compiler = cnDelphi5) or (Compiler = cnBCB5) then begin if not QueryDlg('This function maybe can NOT run correctly in Delphi 5 or C++Builder 5 for an OTA Bug.' + #13#10#13#10 + 'Do you want to Continue?', False) then Exit; end;
for I := Low(T) to High(T) do begin // Lineas.Add(''+IntToStr(I)); if T[I].Kind =tkUnknown then Lineas.Add('tkUnknown '+IntToStr(I)); if T[I].Kind =tkInteger then Lineas.Add('tkInteger '+IntToStr(I)); if T[I].Kind =tkChar then Lineas.Add('tkChar '+IntToStr(I)); if T[I].Kind =tkEnumeration then Lineas.Add('tkEnumeration '+IntToStr(I)); if T[I].Kind =tkFloat then Lineas.Add('tkFloat '+IntToStr(I)); if T[I].Kind =tkString then Lineas.Add('tkString '+IntToStr(I)); if T[I].Kind =tkSet then Lineas.Add('tkSet '+IntToStr(I)); if T[I].Kind =tkClass then Lineas.Add('tkClass '+IntToStr(I)); if T[I].Kind =tkMethod then Lineas.Add('tkMethod '+IntToStr(I)); if T[I].Kind =tkWChar then Lineas.Add('tkWChar '+IntToStr(I)); if T[I].Kind =tkLString then Lineas.Add('tkLString '+IntToStr(I)); if T[I].Kind =tkWString then Lineas.Add('tkWString '+IntToStr(I)); if T[I].Kind =tkVariant then Lineas.Add('tkVariant '+IntToStr(I)); if T[I].Kind =tkArray then Lineas.Add('tkArray '+IntToStr(I)); if T[I].Kind =tkRecord then Lineas.Add('tkRecord '+IntToStr(I)); if T[I].Kind =tkInterface then Lineas.Add('tkInterface '+IntToStr(I)); if T[I].Kind =tkInt64 then Lineas.Add('tkInt64 '+IntToStr(I)); if T[I].Kind =tkDynArray then Lineas.Add('tkDynArray '+IntToStr(I)); // ShowMessage(T[I].Name); end; Lineas.SaveToFile('H:\test.inc');
if QueryDlg(Format('Current Project Version is %d.%d.%d.%d. Inc the Build Number?', [MajorVer, MinorVer, ReleaseNo, BuildNo]), False) then begin BuildNo := BuildNo + 1; CnOtaSetProjectOptionValue(Options, 'Build', Format('%d', [BuildNo])); CnOtaSetProjectOptionValue(Options, 'MajorVersion', Format('%d', [YearOf(Now)])); CnOtaSetProjectOptionValue(Options, 'MinorVersion', Format('%d', [MonthOf(Now)])); CnOtaSetProjectOptionValue(Options, 'Release', Format('%d', [DayOf(Now)])); CnOtaSetProjectOptionValue(Options, 'CompanyName', DateTimeToStr(Now)); // Re-Get the Versions. MajorVer := Options.GetOptionValue('MajorVersion'); MinorVer := Options.GetOptionValue('MinorVersion'); ReleaseNo := Options.GetOptionValue('Release'); BuildNo := Options.GetOptionValue('Build');
// Note: In Delphi 5/C++Builder 5, there's a BUG. // Nubers are correct here, but maybe unchanged in Project Options Dialog. InfoDlg(Format('Current Project Version is %d.%d.%d.%d.%s.', [MajorVer, MinorVer, ReleaseNo, BuildNo,DateTimeToStr(Now) ])); end; end.
----------------------------------------------
[alias] co = clone --recurse-submodules up = submodule update --init --recursiveupd = pullinfo = statusrest = reset --hard懒鬼提速https://www.cctry.com/>http://qalculate.github.io/downloads.htmlhttps://www.cctry.com/
1 VERSIONINFO FILEVERSION 1,0,0,0 PRODUCTVERSION 1,0,0,0 FILEOS 0x4 FILETYPE 0x2 { BLOCK "StringFileInfo" { BLOCK "040904E4" { VALUE "CompanyName", "CompanyName" VALUE "FileDescription", "Project1" VALUE "FileVersion", "1.0.0.0" VALUE "InternalName", "InternalName" VALUE "LegalCopyright", "LegalCopyright" VALUE "LegalTrademarks", "LegalTrademarks" VALUE "OriginalFilename", "OriginalFilename" VALUE "ProgramID", "com.embarcadero.Project1" VALUE "ProductName", "Project1" VALUE "ProductVersion", "1.0.0.0" VALUE "Comments", "Comments" VALUE "PrivateBuild", "PrivateBuild" VALUE "SpecialBuild", "SpecialBuild" } }