卸载顺序 [英] Uninstallation order
问题描述
我可以在卸载期间执行事件和节的实际顺序中找到某个地方吗?例如,UninstallDelete
是否会比usPostUninstall
卸载步骤更早出现?
Can I find somewhere actual order, in which events and sections are executed during uninstall? For example, will UninstallDelete
occur earlier than usPostUninstall
uninstall step?
Inno Setup在手册中有安装顺序"文章,但看起来更像是编译顺序,而不是执行顺序.
Inno Setup has "Installation order" article in manual, but it looks more like compilation order, not execution.
推荐答案
卸载顺序与安装顺序(实际上是安装顺序,而不是编译顺序).
The uninstallation order is an opposite of the installation order, just as the manual says (and it is really the installation order, not a compilation order).
这仅仅是因为没有编程的卸载顺序.安装程序将其步骤记录到卸载日志中,并且卸载程序仅以相反的顺序处理日志,而没有任何更改顺序的选项.
It's simply because there's no programmed uninstallation order. The installer records its steps into uninstall log and the uninstaller just processes the log in an opposite order, without any option to alter the order.
事件函数适用于卸载过程,如下所示(仅主要显示的卸载步骤):
The event functions fit in the uninstallation process as follows (only major uninstallation steps shown):
-
CurUninstallStepChanged(usAppMutexCheck)
-
InitializeUninstallProgressForm
-
CurUninstallStepChanged(usUninstall)
- 处理卸载日志:
-
[UninstallRun]
- 注册表项
- 图标
- 文件
- 应用程序目录
-
[UninstallDelete]
CurUninstallStepChanged(usAppMutexCheck)
InitializeUninstallProgressForm
CurUninstallStepChanged(usUninstall)
- Processing the uninstall log:
[UninstallRun]
- registry entries
- icons
- files
- application directory
[UninstallDelete]
我已经在一个简单的安装程序上对此进行了测试:
I've tested this on a simple installer:
[Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My Program DefaultGroupName=My Program UninstallDisplayIcon={app}\MyProg.exe OutputDir=. [Files] Source: "MyProg.exe"; DestDir: "{app}" [Icons] Name: "{group}\My Program"; Filename: "{app}\MyProg.exe" [UninstallRun] FileName: "{app}\MyProg.exe" [UninstallDelete] Type: files; Name: "{app}\test.dat"
[Code] function InitializeUninstall(): Boolean; begin Log('InitializeUninstall'); Result := True; end; procedure InitializeUninstallProgressForm; begin Log('InitializeUninstallProgressForm'); end; procedure DeinitializeUninstall; begin Log('DeinitializeUninstall'); end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); begin Log('CurUninstallStepChanged + ' + IntToStr(Integer(CurUninstallStep))); end;
卸载程序日志类似于(它不会显示所有步骤):
The uninstaller log is like (it does not show all the steps):
2015-07-19 10:47:54.845 Log opened. (Time zone: UTC+02:00) 2015-07-19 10:47:54.846 Setup version: Inno Setup version 5.5.5 (u) 2015-07-19 10:47:54.846 Original Uninstall EXE: C:\Program Files (x86)\My Program\unins000.exe 2015-07-19 10:47:54.846 Uninstall DAT: C:\Program Files (x86)\My Program\unins000.dat 2015-07-19 10:47:54.846 Uninstall command line: /SECONDPHASE="C:\Program Files (x86)\My Program\unins000.exe" /FIRSTPHASEWND=$1309D4 /INITPROCWND=$2509E4 /log=b:\uninstall\uninstall.log 2015-07-19 10:47:54.846 Windows version: 6.3.9600 (NT platform: Yes) 2015-07-19 10:47:54.846 64-bit Windows: Yes 2015-07-19 10:47:54.846 Processor architecture: x64 2015-07-19 10:47:54.846 User privileges: Administrative 2015-07-19 10:47:54.846 64-bit install mode: No 2015-07-19 10:47:54.846 Created temporary directory: C:\Users\martin\AppData\Local\Temp\is-4R498.tmp 2015-07-19 10:47:54.860 InitializeUninstall 2015-07-19 10:47:54.860 Message box (Yes/No): Are you sure you want to completely remove My Program and all of its components? 2015-07-19 10:47:55.797 User chose Yes. 2015-07-19 10:47:55.797 CurUninstallStepChanged + 0 2015-07-19 10:47:55.802 InitializeUninstallProgressForm 2015-07-19 10:47:55.810 CurUninstallStepChanged + 1 2015-07-19 10:47:55.810 Starting the uninstallation process. 2015-07-19 10:47:55.810 Running Exec filename: C:\Program Files (x86)\My Program\MyProg.exe 2015-07-19 10:47:57.111 Process exit code: 0 2015-07-19 10:47:57.143 Deleting file: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\My Program\My Program.lnk 2015-07-19 10:47:57.144 Deleting directory: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\My Program 2015-07-19 10:47:57.144 Deleting file: C:\Program Files (x86)\My Program\MyProg.exe 2015-07-19 10:47:57.145 Deleting directory: C:\Program Files (x86)\My Program 2015-07-19 10:47:57.145 Failed to delete directory (145). Will retry later. 2015-07-19 10:47:57.145 Deleting file: C:\Program Files (x86)\My Program\test.dat 2015-07-19 10:47:57.145 Deleting Uninstall data files. 2015-07-19 10:47:57.662 Deleting directory: C:\Program Files (x86)\My Program 2015-07-19 10:47:57.665 Uninstallation process succeeded. 2015-07-19 10:47:57.665 Removed all? Yes 2015-07-19 10:47:57.665 Need to restart Windows? No 2015-07-19 10:47:57.668 CurUninstallStepChanged + 2 2015-07-19 10:47:57.668 Message box (OK): My Program was successfully removed from your computer. 2015-07-19 10:47:58.342 User chose OK. 2015-07-19 10:47:58.342 CurUninstallStepChanged + 3 2015-07-19 10:47:58.342 DeinitializeUninstall 2015-07-19 10:47:58.343 Log closed.
这篇关于卸载顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
-