inno setup检查是否已经安装
[Registry] Root: HKLM; Subkey: "Software\MCS"; ValueType: string; ValueName: "MCSVersion"; ValueData: "1.0.6"; Flags: uninsdeletevalue [Code] function GetMCSVersion(): String; var MCSVersion: String; begin MCSVersion :=''; RegQueryStringValue(HKLM, 'Software\MCS', 'MCSVersion', MCSVersion); Result := MCSVersion; end; function InitializeSetup(): Boolean; var MCSVersion: String; begin MCSVersion := GetMCSVersion(); result := true; if length(MCSVersion) > 0 then begin //如果发现程序已经安装过了 MsgBox ('本程序已经安装,请卸载后再安装本程序. 安装程序将关闭.', mbError, MB_OK); result := false; end; end;