我们最近从一个基于msi的Visual Studio安装程序转移到了Inno安装程序,但是我们在使用这个新的安装程序升级现有安装程序时遇到了问题。我知道即使产品代码每次更新都会更改,升级代码仍然保持不变,所以我最初尝试在Inno Setup项目中将其设置为AppId,但这不起作用。然后我尝试了一些其他的guid,但都不起作用。
有没有办法用Inno安装程序正确升级msi安装?
发布于 2009-05-05 15:57:21
不,我不这么认为- InnoSetup是明确的而不是一个基于MSI的安装器。
您需要首先使用例如msiexec /X (产品代码或MSI文件名)正确卸载旧的基于MSI的安装,然后您可以使用InnoSetup安装新的东西。
发布于 2009-06-20 22:06:27
要从Inno安装程序中安装.MSI文件,请尝试以下代码行:
[Files]
Source: "Your-MSI-File.msi"; DestDir: "{tmp}"
[Run]
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\Your-MSI-File.msi"""致谢给Alex Yackimoff http://www.jrsoftware.org/iskb.php?msi
发布于 2021-10-13 16:40:37
我需要使用MSI包(替换为Inno Setup installer)。我使用Inno安装程序中的以下代码在安装时自动卸载MSI包(如果已安装):
function PrepareToInstall(var NeedsRestart: Boolean): string;
var
OldAppGuid, SubKeyName: string;
OldAppFound: Boolean;
ResultCode: Integer;
begin
NeedsRestart := false;
result := '';
if IsAdminInstallMode() then
begin
OldAppGuid := '{nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn}';
SubKeyName := 'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\' + OldAppGuid;
OldAppFound := RegKeyExists(HKEY_LOCAL_MACHINE, SubKeyName);
if not OldAppFound then
begin
SubKeyName := 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + OldAppGuid;
OldAppFound := RegKeyExists(HKEY_LOCAL_MACHINE, SubKeyName);
end;
if OldAppFound then
begin
Exec(ExpandConstant('{sys}\msiexec.exe'), // Filename
'/X ' + OldAppGuid + ' /qb- REBOOT=ReallySuppress', // Params
'', // WorkingDir
SW_SHOW, // ShowCmd
ewWaitUntilTerminated, // Wait
ResultCode); // ResultCode
end;
end;
end;当然,将{nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn}替换为MSI包的产品ID GUID。
https://stackoverflow.com/questions/825576
复制相似问题