[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;
未经允许不得转载作者:
System,
转载或复制请以
超链接形式
并注明出处
科技之星网站 。
原文地址:
《
如何使用 Inno Setup 制作软件智能升级更新补丁》
发布于
2024-11-14
(禁止商用或其它牟利行为)版权归原作者本人所有,您必须在下载后24小时内删除, 感谢您的理解与合作







评论 抢沙发
评论前必须登录!
立即登录 注册