[Setup]
AppName=科技之星
AppVersion=2.0
DefaultDirName={pf}\YourAppName
[Code]
const
OldVersionRegPath = 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppId")}_is1';
OldVersionInstallLocationKey = 'InstallLocation';
function GetOldVersionInstallPath: string;
var
RegValue: string;
begin
if not RegQueryStringValue(HKLM, OldVersionRegPath, OldVersionInstallLocationKey, RegValue) then
RegQueryStringValue(HKCU, OldVersionRegPath, OldVersionInstallLocationKey, RegValue);
Result := RegValue;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
OldInstallPath: string;
begin
if CurStep = ssInstall then
begin
OldInstallPath := GetOldVersionInstallPath;
if DirExists(OldInstallPath) then
begin
// 复制新的文件替换旧版本
FileCopy('NewFiles\*', OldInstallPath, False, True);
end;
end;
end;
GRUD11 个月前
通告声明: 关于回帖问题 由于本站长要求,禁止刷1234等!存在恶意灌水回复,已开启自动审核制,自动封闭IP,禁止再次注册!请知晓!
有什么问题群内咨询 561116458
System1 年前
网络技术QQ:561116458
科技之星①群:669812887
软件共享群:34008xxxx【因为是VIP软件不公开】
视频教程 短视频平台搜索:科技之星网络