当AppId包含大括号时,检查安装是全新的还是升级不起作用 [英] Checking if installation is fresh or upgrade does not work when AppId contains a curly bracket
问题描述
我尝试运行相同的安装程序以进行全新安装和升级.
I try to run same installer for fresh installation and upgrade.
如果是升级,则不应复制某些文件和文件夹,并且不应运行 server.bat
.我使用了已在问题上得到解答的函数(
In case it is an upgrade: some files and folders shouldn’t be copy and server.bat
shouldn’t be run.
I use the function as it has been answered on the question (Can Inno Setup respond differently to a new install and an update?) and I used same AppId
and defined the #SetupReg
as it shown, and install the app for first time, and everything is good, but when I searched Setup Log I found that:
Line 122: 2019-02-27 15:46:13.797 Creating new uninstall key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{FDDFBC15-7B5C-4580-AD69-F54B8087A52E}_is1
然后我搜索了注册表,但上面的路径不存在,但是我在
Then I searched Registry and above path doesn’t exist, but I found the actually SetupReg path in
HKLM \软件\ Wow6432Node \ Microsoft \ Windows \ CurrentVersion \ Uninstall \{FDDFBC15-7B5C-4580-AD69-F54B8087A52E} _is1
HKLM\Softwares\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ {FDDFBC15-7B5C-4580-AD69-F54B8087A52E}_is1
我已经将其定义为脚本打击,脚本中的路径为:
I already defined it as script blow, the path in script was:
HKLM \ Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall \"+ AppId+"_is1
HKLM\ Software\Microsoft\Windows\CurrentVersion\Uninstall\" + AppId + "_is1
我编辑 MyApp.iss
,并将 MyAppVersion
的值更改为"1.1.0"
和 VersionInfoVersion
1.1.0
,然后再次运行安装程序,我希望它将运行升级(具有 check:not IsUpgrade
的文件和文件夹不应复制或运行),它将禁用安装目录页面.但是什么也没发生.函数 IsUpgrade
无法成功运行,具有 check:not IsUpgrade
的文件和文件夹已被正常复制并覆盖了旧的文件和文件夹,甚至覆盖了 server.bat
覆盖旧版本,并在安装完成后运行.怎么了是因为 #SetupReg
或函数IsUpgrade
还是iss脚本?
I edit MyApp.iss
and changed values of MyAppVersion
to "1.1.0"
and VersionInfoVersion
to 1.1.0
, and run installer again, I expected it will run an upgrade (files and folder which has check: not IsUpgrade
shouldn’t copy or run) and it will disable installation directory page. But nothing expected happen.
The function IsUpgrade
didn’t work successfully, files and folders which has check: not IsUpgrade
have been copied normally and overwrote the old one, even the server.bat
overwrote the old one and also run after installation finished.
What’s going wrong? Is it because of #SetupReg
or function IsUpgrade
or iss script?
#define MyAppName "Medfor"
#define MyAppVersion "1.0.0"
#define MyAppExeName "Medfor.exe"
#define AppId "{{FDDFBC15-7B5C-4580-AD69-F54B8087A52E}"
#define SetupReg "Software\Microsoft\Windows\CurrentVersion\Uninstall\" + AppId + "_is1"
#define SetupAppPathReg "Inno Setup: App Path"
[Setup]
AppId={#AppId}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
[Files]
Source: "build\server.bat"; DestDir: "{app}"; Flags: ignoreversion; Check: not IsUpgrade
[Run]
Filename: "{app}\server.bat"; \
Flags: postinstall skipifsilent runascurrentuser waituntilterminated; \
Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; \
Check: not IsUpgrade
[Code]
function IsUpgrade: Boolean;
var
S: string;
begin
Result :=
RegQueryStringValue(HKLM, '{#SetupReg}', '{#SetupAppPathReg}', S) or
RegQueryStringValue(HKCU, '{#SetupReg}', '{#SetupAppPathReg}', S);
end;
第一个安装日志:
2019-02-27 15:45:48.996 Log opened. (Time zone: UTC+03:00)
2019-02-27 15:45:48.996 Setup version: Inno Setup version 5.6.1 (a)
2019-02-27 15:45:48.996 Original Setup EXE: C:\Users\user\Documents\Output\Medfor-setup.exe
2019-02-27 15:45:48.996 Setup command line: /SL5="$2307BA,9890028,58368,C:\Users\user\Documents\Output\Medfor-setup.exe" /SPAWNWND=$2B04B6 /NOTIFYWND=$390B4C
2019-02-27 15:45:48.997 Windows version: 6.3.9600 (NT platform: Yes)
2019-02-27 15:45:48.997 64-bit Windows: Yes
2019-02-27 15:45:48.997 Processor architecture: x64
2019-02-27 15:45:48.997 User privileges: Administrative
2019-02-27 15:45:48.999 64-bit install mode: No
2019-02-27 15:45:49.004 Created temporary directory: C:\Users\user\AppData\Local\Temp\is-IH9A3.tmp
2019-02-27 15:46:11.561 Starting the installation process.
2019-02-27 15:46:11.690 Creating directory: C:\Program Files (x86)\Medfor
2019-02-27 15:46:11.690 Creating directory: C:\Program Files (x86)\Medfor\App
2019-02-27 15:46:11.691 Creating directory: C:\Program Files (x86)\Medfor\App\sections
2019-02-27 15:46:11.691 Creating directory: C:\Program Files (x86)\Medfor\App\sections\templates_sections
2019-02-27 15:46:11.691 Creating directory: C:\Program Files (x86)\Medfor\App\sections\templates_sections\headers
2019-02-27 15:46:11.692 Creating directory: C:\Program Files (x86)\Medfor\App\sections\templates_sections\modals
2019-02-27 15:46:11.693 Creating directory: C:\Program Files (x86)\Medfor\App\templates
2019-02-27 15:46:11.693 Creating directory: C:\Program Files (x86)\Medfor\App\templates\errors
2019-02-27 15:46:11.694 Creating directory: C:\Program Files (x86)\Medfor\App\templates\menus
2019-02-27 15:46:11.694 Creating directory: C:\Program Files (x86)\Medfor\App\templates\modals
2019-02-27 15:46:11.695 Creating directory: C:\Program Files (x86)\Medfor\Uploads
2019-02-27 15:46:11.696 Directory for uninstall files: C:\Program Files (x86)\Medfor
2019-02-27 15:46:11.696 Creating new uninstall log: C:\Program Files (x86)\Medfor\unins000.dat
2019-02-27 15:46:11.701 -- File entry --
2019-02-27 15:46:11.702 Dest filename: C:\Program Files (x86)\Medfor\unins000.exe
2019-02-27 15:46:11.705 Time stamp of our file: 2019-02-27 15:45:48.834
2019-02-27 15:46:11.705 Installing the file.
2019-02-27 15:46:11.719 Uninstaller requires administrator: Yes
2019-02-27 15:46:11.720 Successfully installed the file.
2019-02-27 15:46:11.721 -- File entry --
2019-02-27 15:46:11.722 Dest filename: C:\Program Files (x86)\Medfor\mfcm90u.dll
2019-02-27 15:46:11.722 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 15:46:11.723 Installing the file.
2019-02-27 15:46:11.731 Successfully installed the file.
2019-02-27 15:46:11.731 -- File entry --
2019-02-27 15:46:11.732 Dest filename: C:\Program Files (x86)\Medfor\Microsoft.VC90.CRT.manifest
2019-02-27 15:46:11.733 Time stamp of our file: 2018-11-25 14:38:08.000
2019-02-27 15:46:11.733 Installing the file.
2019-02-27 15:46:11.735 Successfully installed the file.
2019-02-27 15:46:11.736 -- File entry --
2019-02-27 15:46:11.737 Dest filename: C:\Program Files (x86)\Medfor\Microsoft.VC90.MFC.manifest
2019-02-27 15:46:11.738 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 15:46:11.738 Installing the file.
2019-02-27 15:46:11.741 Successfully installed the file.
2019-02-27 15:46:11.741 -- File entry --
2019-02-27 15:46:11.743 Dest filename: C:\Program Files (x86)\Medfor\msvcm90.dll
2019-02-27 15:46:11.743 Time stamp of our file: 2018-11-25 14:38:08.000
2019-02-27 15:46:11.743 Installing the file.
2019-02-27 15:46:11.766 Successfully installed the file.
2019-02-27 15:46:11.766 -- File entry --
2019-02-27 15:46:11.767 Dest filename: C:\Program Files (x86)\Medfor\msvcp90.dll
2019-02-27 15:46:11.768 Time stamp of our file: 2018-11-25 14:38:08.000
2019-02-27 15:46:11.768 Installing the file.
2019-02-27 15:46:11.837 Successfully installed the file.
2019-02-27 15:46:11.837 -- File entry --
2019-02-27 15:46:11.839 Dest filename: C:\Program Files (x86)\Medfor\msvcr90.dll
2019-02-27 15:46:11.839 Time stamp of our file: 2018-11-25 14:38:08.000
2019-02-27 15:46:11.839 Installing the file.
2019-02-27 15:46:11.913 Successfully installed the file.
2019-02-27 15:46:11.914 -- File entry --
2019-02-27 15:46:11.914 Dest filename: C:\Program Files (x86)\Medfor\service.bat
2019-02-27 15:46:11.915 Time stamp of our file: 2018-12-16 16:53:52.000
2019-02-27 15:46:11.915 Installing the file.
2019-02-27 15:46:11.917 Successfully installed the file.
2019-02-27 15:46:11.917 -- File entry --
2019-02-27 15:46:11.918 Dest filename: C:\Program Files (x86)\Medfor\sqlite3.dll
2019-02-27 15:46:11.918 Time stamp of our file: 2018-11-25 14:38:26.000
2019-02-27 15:46:11.918 Installing the file.
2019-02-27 15:46:12.012 Successfully installed the file.
2019-02-27 15:46:12.012 -- File entry --
2019-02-27 15:46:12.013 Dest filename: C:\Program Files (x86)\Medfor\tcl85.dll
2019-02-27 15:46:12.013 Time stamp of our file: 2018-11-25 14:38:26.000
2019-02-27 15:46:12.013 Installing the file.
2019-02-27 15:46:12.143 Successfully installed the file.
2019-02-27 15:46:12.143 -- File entry --
2019-02-27 15:46:12.145 Dest filename: C:\Program Files (x86)\Medfor\medfor.dll
2019-02-27 15:46:12.145 Time stamp of our file: 2019-02-27 13:15:42.000
2019-02-27 15:46:12.145 Installing the file.
2019-02-27 15:46:12.148 Successfully installed the file.
2019-02-27 15:46:12.149 -- File entry --
2019-02-27 15:46:12.149 Dest filename: C:\Program Files (x86)\Medfor\Medfor.exe
2019-02-27 15:46:12.150 Time stamp of our file: 2018-10-29 02:05:20.000
2019-02-27 15:46:12.150 Installing the file.
2019-02-27 15:46:12.790 Successfully installed the file.
2019-02-27 15:46:12.791 -- File entry --
2019-02-27 15:46:12.791 Dest filename: C:\Program Files (x86)\Medfor\mfc90.dll
2019-02-27 15:46:12.792 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 15:46:12.792 Installing the file.
2019-02-27 15:46:13.287 Successfully installed the file.
2019-02-27 15:46:13.287 -- File entry --
2019-02-27 15:46:13.288 Dest filename: C:\Program Files (x86)\Medfor\mfc90u.dll
2019-02-27 15:46:13.288 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 15:46:13.288 Installing the file.
2019-02-27 15:46:13.541 Successfully installed the file.
2019-02-27 15:46:13.541 -- File entry --
2019-02-27 15:46:13.542 Dest filename: C:\Program Files (x86)\Medfor\mfcm90.dll
2019-02-27 15:46:13.542 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 15:46:13.542 Installing the file.
2019-02-27 15:46:13.549 Successfully installed the file.
2019-02-27 15:46:13.549 -- File entry --
2019-02-27 15:46:13.550 Dest filename: C:\Program Files (x86)\Medfor\App\templates\errors\403.html
2019-02-27 15:46:13.550 Time stamp of our file: 2018-11-21 16:21:04.000
2019-02-27 15:46:13.550 Installing the file.
2019-02-27 15:46:13.552 Successfully installed the file.
2019-02-27 15:46:13.552 -- File entry --
2019-02-27 15:46:13.553 Dest filename: C:\Program Files (x86)\Medfor\App\templates\errors\404.html
2019-02-27 15:46:13.553 Time stamp of our file: 2018-11-21 16:21:04.000
2019-02-27 15:46:13.553 Installing the file.
2019-02-27 15:46:13.555 Successfully installed the file.
2019-02-27 15:46:13.555 -- File entry --
2019-02-27 15:46:13.556 Dest filename: C:\Program Files (x86)\Medfor\Uploads\Capture.gif
2019-02-27 15:46:13.557 Time stamp of our file: 2018-07-31 21:51:14.000
2019-02-27 15:46:13.557 Installing the file.
2019-02-27 15:46:13.565 Successfully installed the file.
2019-02-27 15:46:13.566 -- Icon entry --
2019-02-27 15:46:13.566 Dest filename: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Medfor.lnk
2019-02-27 15:46:13.568 Creating the icon.
2019-02-27 15:46:13.794 Successfully created the icon.
2019-02-27 15:46:13.797 Saving uninstall information.
2019-02-27 15:46:13.797 Deleting any uninstall keys left over from previous installs
2019-02-27 15:46:13.797 Creating new uninstall key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{FDDFBC15-7B5C-4580-AD69-F54B8087A52E}_is1
2019-02-27 15:46:13.797 Writing uninstall key values.
2019-02-27 15:46:13.961 Installation process succeeded.
2019-02-27 15:46:13.963 Need to restart Windows? No
2019-02-27 15:46:21.260 -- Run entry --
2019-02-27 15:46:21.260 Run as: Current user
2019-02-27 15:46:21.260 Type: Exec
2019-02-27 15:46:21.260 Filename: C:\Program Files (x86)\Medfor\service.bat
2019-02-27 15:46:27.225 Process exit code: 1
2019-02-27 15:46:27.225 -- Run entry --
2019-02-27 15:46:27.225 Run as: Original user
2019-02-27 15:46:27.225 Type: Exec
2019-02-27 15:46:27.225 Filename: C:\Program Files (x86)\Medfor\Medfor.exe
第二个安装日志(预期升级)
Second Installation Log (Expected Upgrade)
2019-02-27 16:42:48.069 Log opened. (Time zone: UTC+03:00)
2019-02-27 16:42:48.070 Setup version: Inno Setup version 5.6.1 (a)
2019-02-27 16:42:48.070 Original Setup EXE: C:\Users\user\Documents\Output\Medfor-1.1.0-setup.exe
2019-02-27 16:42:48.070 Setup command line: /SL5="$4A052C,9889159,58368,C:\Users\user\Documents\Output\Medfor-1.1.0-setup.exe" /SPAWNWND=$9C0140 /NOTIFYWND=$5F02BC
2019-02-27 16:42:48.070 Windows version: 6.3.9600 (NT platform: Yes)
2019-02-27 16:42:48.070 64-bit Windows: Yes
2019-02-27 16:42:48.071 Processor architecture: x64
2019-02-27 16:42:48.071 User privileges: Administrative
2019-02-27 16:42:48.074 64-bit install mode: No
2019-02-27 16:42:48.082 Created temporary directory: C:\Users\user\AppData\Local\Temp\is-Q7EVG.tmp
2019-02-27 16:43:13.652 Starting the installation process.
2019-02-27 16:43:13.662 Directory for uninstall files: C:\Program Files (x86)\Medfor
2019-02-27 16:43:13.662 Will append to existing uninstall log: C:\Program Files (x86)\Medfor\unins000.dat
2019-02-27 16:43:13.668 -- File entry --
2019-02-27 16:43:13.669 Dest filename: C:\Program Files (x86)\Medfor\unins000.exe
2019-02-27 16:43:13.673 Time stamp of our file: 2019-02-27 16:42:47.947
2019-02-27 16:43:13.673 Dest file exists.
2019-02-27 16:43:13.673 Time stamp of existing file: 2019-02-27 15:45:48.834
2019-02-27 16:43:13.673 Version of our file: 51.52.0.0
2019-02-27 16:43:13.674 Version of existing file: 51.52.0.0
2019-02-27 16:43:13.674 Installing the file.
2019-02-27 16:43:13.700 Uninstaller requires administrator: Yes
2019-02-27 16:43:13.700 Leaving temporary file in place for now.
2019-02-27 16:43:13.701 -- File entry --
2019-02-27 16:43:13.703 Dest filename: C:\Program Files (x86)\Medfor\mfcm90u.dll
2019-02-27 16:43:13.703 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 16:43:13.703 Dest file exists.
2019-02-27 16:43:13.703 Time stamp of existing file: 2018-11-25 14:38:14.000
2019-02-27 16:43:13.704 Installing the file.
2019-02-27 16:43:13.716 Successfully installed the file.
2019-02-27 16:43:13.716 -- File entry --
2019-02-27 16:43:13.718 Dest filename: C:\Program Files (x86)\Medfor\Microsoft.VC90.CRT.manifest
2019-02-27 16:43:13.719 Time stamp of our file: 2018-11-25 14:38:08.000
2019-02-27 16:43:13.719 Dest file exists.
2019-02-27 16:43:13.719 Time stamp of existing file: 2018-11-25 14:38:08.000
2019-02-27 16:43:13.719 Installing the file.
2019-02-27 16:43:13.724 Successfully installed the file.
2019-02-27 16:43:13.725 -- File entry --
2019-02-27 16:43:13.727 Dest filename: C:\Program Files (x86)\Medfor\Microsoft.VC90.MFC.manifest
2019-02-27 16:43:13.728 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 16:43:13.728 Dest file exists.
2019-02-27 16:43:13.728 Time stamp of existing file: 2018-11-25 14:38:14.000
2019-02-27 16:43:13.728 Installing the file.
2019-02-27 16:43:13.733 Successfully installed the file.
2019-02-27 16:43:13.734 -- File entry --
2019-02-27 16:43:13.735 Dest filename: C:\Program Files (x86)\Medfor\msvcm90.dll
2019-02-27 16:43:13.736 Time stamp of our file: 2018-11-25 14:38:08.000
2019-02-27 16:43:13.736 Dest file exists.
2019-02-27 16:43:13.736 Time stamp of existing file: 2018-11-25 14:38:08.000
2019-02-27 16:43:13.736 Installing the file.
2019-02-27 16:43:13.770 Successfully installed the file.
2019-02-27 16:43:13.771 -- File entry --
2019-02-27 16:43:13.773 Dest filename: C:\Program Files (x86)\Medfor\msvcp90.dll
2019-02-27 16:43:13.773 Time stamp of our file: 2018-11-25 14:38:08.000
2019-02-27 16:43:13.774 Dest file exists.
2019-02-27 16:43:13.774 Time stamp of existing file: 2018-11-25 14:38:08.000
2019-02-27 16:43:13.774 Installing the file.
2019-02-27 16:43:13.870 Successfully installed the file.
2019-02-27 16:43:13.871 -- File entry --
2019-02-27 16:43:13.872 Dest filename: C:\Program Files (x86)\Medfor\msvcr90.dll
2019-02-27 16:43:13.873 Time stamp of our file: 2018-11-25 14:38:08.000
2019-02-27 16:43:13.873 Dest file exists.
2019-02-27 16:43:13.873 Time stamp of existing file: 2018-11-25 14:38:08.000
2019-02-27 16:43:13.873 Installing the file.
2019-02-27 16:43:13.977 Successfully installed the file.
2019-02-27 16:43:13.978 -- File entry --
2019-02-27 16:43:13.980 Dest filename: C:\Program Files (x86)\Medfor\server.bat
2019-02-27 16:43:13.981 Time stamp of our file: 2019-02-27 16:37:22.000
2019-02-27 16:43:13.981 Dest file exists.
2019-02-27 16:43:13.981 Time stamp of existing file: 2019-02-27 16:40:59.984
2019-02-27 16:43:13.981 Installing the file.
2019-02-27 16:43:13.985 Successfully installed the file.
2019-02-27 16:43:13.986 -- File entry --
2019-02-27 16:43:13.987 Dest filename: C:\Program Files (x86)\Medfor\sqlite3.dll
2019-02-27 16:43:13.988 Time stamp of our file: 2018-11-25 14:38:26.000
2019-02-27 16:43:13.988 Dest file exists.
2019-02-27 16:43:13.988 Time stamp of existing file: 2018-11-25 14:38:26.000
2019-02-27 16:43:13.988 Installing the file.
2019-02-27 16:43:14.159 Successfully installed the file.
2019-02-27 16:43:14.193 -- File entry --
2019-02-27 16:43:14.194 Dest filename: C:\Program Files (x86)\Medfor\tcl85.dll
2019-02-27 16:43:14.195 Time stamp of our file: 2018-11-25 14:38:26.000
2019-02-27 16:43:14.195 Dest file exists.
2019-02-27 16:43:14.195 Time stamp of existing file: 2018-11-25 14:38:26.000
2019-02-27 16:43:14.195 Installing the file.
2019-02-27 16:43:14.421 Successfully installed the file.
2019-02-27 16:43:14.422 -- File entry --
2019-02-27 16:43:14.424 Dest filename: C:\Program Files (x86)\Medfor\medfor.dll
2019-02-27 16:43:14.424 Time stamp of our file: 2019-02-27 13:15:42.000
2019-02-27 16:43:14.425 Dest file exists.
2019-02-27 16:43:14.425 Time stamp of existing file: 2019-02-27 13:15:42.000
2019-02-27 16:43:14.425 Installing the file.
2019-02-27 16:43:14.431 Successfully installed the file.
2019-02-27 16:43:14.431 -- File entry --
2019-02-27 16:43:14.433 Dest filename: C:\Program Files (x86)\Medfor\Medfor.exe
2019-02-27 16:43:14.434 Time stamp of our file: 2018-10-29 02:05:20.000
2019-02-27 16:43:14.434 Dest file exists.
2019-02-27 16:43:14.434 Time stamp of existing file: 2018-10-29 02:05:20.000
2019-02-27 16:43:14.434 Installing the file.
2019-02-27 16:43:15.386 Successfully installed the file.
2019-02-27 16:43:15.387 -- File entry --
2019-02-27 16:43:15.388 Dest filename: C:\Program Files (x86)\Medfor\mfc90.dll
2019-02-27 16:43:15.389 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 16:43:15.389 Dest file exists.
2019-02-27 16:43:15.389 Time stamp of existing file: 2018-11-25 14:38:14.000
2019-02-27 16:43:15.389 Installing the file.
2019-02-27 16:43:16.087 Successfully installed the file.
2019-02-27 16:43:16.088 -- File entry --
2019-02-27 16:43:16.089 Dest filename: C:\Program Files (x86)\Medfor\mfc90u.dll
2019-02-27 16:43:16.089 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 16:43:16.089 Dest file exists.
2019-02-27 16:43:16.089 Time stamp of existing file: 2018-11-25 14:38:14.000
2019-02-27 16:43:16.090 Installing the file.
2019-02-27 16:43:16.432 Successfully installed the file.
2019-02-27 16:43:16.432 -- File entry --
2019-02-27 16:43:16.434 Dest filename: C:\Program Files (x86)\Medfor\mfcm90.dll
2019-02-27 16:43:16.435 Time stamp of our file: 2018-11-25 14:38:14.000
2019-02-27 16:43:16.435 Dest file exists.
2019-02-27 16:43:16.435 Time stamp of existing file: 2018-11-25 14:38:14.000
2019-02-27 16:43:16.435 Installing the file.
2019-02-27 16:43:16.450 Successfully installed the file.
2019-02-27 16:43:16.450 -- File entry --
2019-02-27 16:43:16.451 Dest filename: C:\Program Files (x86)\Medfor\App\templates\errors\403.html
2019-02-27 16:43:16.452 Time stamp of our file: 2018-11-21 16:21:04.000
2019-02-27 16:43:16.452 Dest file exists.
2019-02-27 16:43:16.452 Time stamp of existing file: 2018-11-21 16:21:04.000
2019-02-27 16:43:16.452 Installing the file.
2019-02-27 16:43:16.455 Successfully installed the file.
2019-02-27 16:43:16.456 -- File entry --
2019-02-27 16:43:16.457 Dest filename: C:\Program Files (x86)\Medfor\App\templates\errors\404.html
2019-02-27 16:43:16.457 Time stamp of our file: 2018-11-21 16:21:04.000
2019-02-27 16:43:16.457 Dest file exists.
2019-02-27 16:43:16.457 Time stamp of existing file: 2018-11-21 16:21:04.000
2019-02-27 16:43:16.457 Installing the file.
2019-02-27 16:43:16.460 Successfully installed the file.
2019-02-27 16:43:16.460 -- File entry --
2019-02-27 16:43:16.461 Dest filename: C:\Program Files (x86)\Medfor\Uploads\Capture.gif
2019-02-27 16:43:16.462 Time stamp of our file: 2018-07-31 21:51:14.000
2019-02-27 16:43:16.462 Dest file exists.
2019-02-27 16:43:16.462 Time stamp of existing file: 2018-07-31 21:51:14.000
2019-02-27 16:43:16.462 Installing the file.
2019-02-27 16:43:16.478 Successfully installed the file.
2019-02-27 16:43:16.480 -- Icon entry --
2019-02-27 16:43:16.480 Dest filename: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Medfor.lnk
2019-02-27 16:43:16.483 Creating the icon.
2019-02-27 16:43:16.630 Successfully created the icon.
2019-02-27 16:43:16.634 Saving uninstall information.
2019-02-27 16:43:16.634 Renaming uninstaller.
2019-02-27 16:43:16.635 Deleting any uninstall keys left over from previous installs
2019-02-27 16:43:16.636 Creating new uninstall key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{FDDFBC15-7B5C-4580-AD69-F54B8087A52E}_is1
2019-02-27 16:43:16.637 Writing uninstall key values.
2019-02-27 16:43:16.828 Installation process succeeded.
2019-02-27 16:43:16.830 Need to restart Windows? No
2019-02-27 16:43:21.677 -- Run entry --
2019-02-27 16:43:21.677 Run as: Current user
2019-02-27 16:43:21.677 Type: Exec
2019-02-27 16:43:21.677 Filename: C:\Program Files (x86)\Medfor\server.bat
2019-02-27 16:43:22.055 Process exit code: 0
2019-02-27 16:43:22.055 -- Run entry --
2019-02-27 16:43:22.055 Run as: Original user
2019-02-27 16:43:22.055 Type: Exec
2019-02-27 16:43:22.055 Filename: C:\Program Files (x86)\Medfor\Medfor.exe
推荐答案
这是因为您的"AddId"是 {xxx}
,而不是 {{xxx}
(您问题中的注册表项路径). AppId
指令中需要双大括号.,例如在Inno Setup指令中,大括号具有特殊含义(对于常量).如果要从字面上使用大括号,则必须将其加倍.
That's because your "AddId" is {xxx}
, not {{xxx}
(check the registry key path in your question). The double curly bracket is needed in AppId
directive, as in Inno Setup directives a curly bracket have a special meaning (for constants). If you want to use a curly bracket literally, you have to double it.
但是在Pascal脚本代码中,大括号没有特殊含义.因此,如果使用两个,则Pascal脚本代码将在注册表中显式查找 {{xxx}
.而且自然不会在那找到它,因为有 {xxx}
.
But in Pascal Script code, a curly bracket has no special meaning. So if you use two, your Pascal Script code will explicitly look for {{xxx}
in the registry. And naturally, it won't find it there, as there's {xxx}
.
解决此问题的一种方法(在指令和代码之间不重复 xxx
)是通过仅在 AppId
指令中使用预处理器将花括号加倍:
One way to solve this (without duplicating xxx
between the directive and the code) is by doubling the curly bracket using preprocessor in the AppId
directive only:
#define AppId "{FDDFBC15-7B5C-4580-AD69-F54B8087A52E}"
; One curly bracket for Pascal Script code
#define SetupReg "Software\Microsoft\Windows\CurrentVersion\Uninstall\" + AppId + "_is1"
[Setup]
; Two curly brackets for directive
AppId={#StringChange(AppId, '{', '{{')}
这篇关于当AppId包含大括号时,检查安装是全新的还是升级不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!