|
| 1 | +[Setup] |
| 2 | +AppName=NVDA 配置恢复工具 |
| 3 | +AppVersion=1.0 |
| 4 | +VersionInfoVersion=1.0 |
| 5 | +AppVerName=NVDA 配置恢复工具 |
| 6 | +DefaultDirName={userappdata}\NVDA |
| 7 | +AllowNoIcons=yes |
| 8 | +OutputDir=. |
| 9 | +OutputBaseFilename=NVDA 配置恢复工具 |
| 10 | +Compression=lzma |
| 11 | +DisableDirPage=Yes |
| 12 | +DisableProgramGroupPage=yes |
| 13 | +AppendDefaultDirName=No |
| 14 | +DirExistsWarning=No |
| 15 | +Uninstallable=No |
| 16 | +SetupIconFile=Application\images\nvda.ico |
| 17 | +ArchitecturesInstallIn64BitMode=x64 ia64 arm64 |
| 18 | +AllowCancelDuringInstall=No |
| 19 | +AlwaysShowComponentsList=No |
| 20 | +ShowComponentSizes=No |
| 21 | +ShowTasksTreeLines=Yes |
| 22 | +RestartIfNeededByRun=no |
| 23 | +ShowLanguageDialog=No |
| 24 | + |
| 25 | +[Languages] |
| 26 | +Name: "chinesesimp"; MessagesFile: "compiler:Default.isl" |
| 27 | + |
| 28 | +[code] |
| 29 | +procedure RestoreNVDAProfile(); |
| 30 | +var |
| 31 | + ResultCode: Integer; |
| 32 | +begin |
| 33 | + if MsgBox('本程序将恢复您在 NVDA 懒人版安装程序所备份的配置到 NVDA 配置文件夹,并还原对简体中文按键与手势的自定义设置。' #13#13 '备份的配置文件成功恢复后将会被删除。' #13#13 '恢复过程需重启您的 NVDA,您要现在恢复吗?', mbConfirmation, MB_YESNO)= IDYES then |
| 34 | + begin |
| 35 | + ShellExec('', ExpandConstant('{commonpf32}\NVDA\nvda.exe'), '-q', '', SW_SHOW, ewWaitUntilTerminated, ResultCode); |
| 36 | + DelTree(ExpandConstant('{userappdata}\NVDA'), True, True, True); |
| 37 | + ExtractTemporaryFile(ExtractFileName(ExpandConstant('{tmp}\7z.dll'))); |
| 38 | + ExtractTemporaryFile(ExtractFileName(ExpandConstant('{tmp}\7z.exe'))); |
| 39 | + Exec(ExpandConstant('{tmp}\7z.exe'), 'x "'+ ExpandConstant('{userdocs}\NVDABackup\NVDABackup.zip" -aoa -o"'+ ExpandConstant('{userappdata}\NVDA')+'"', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); |
| 40 | + DelTree(ExpandConstant('{userdocs}\NVDABackup'), True, True, True); |
| 41 | + DeleteIniSection('globalPlugins.DragAndDrop.GlobalPlugin', ExpandConstant('{commonpf32}\NVDA\locale\zh_CN\gestures.ini')); |
| 42 | + ShellExec('', ExpandConstant('{commonpf32}\NVDA\nvda.exe'), '', '', SW_SHOW, ewNoWait, ResultCode); |
| 43 | + MsgBox('恭喜,操作成功!', mbInformation, MB_OK); |
| 44 | + end; |
| 45 | +end; |
| 46 | +function InitializeSetup: Boolean; |
| 47 | +begin |
| 48 | + if FileExists(ExpandConstant('{userdocs}\NVDABackup\NVDABackup.zip')) = True then |
| 49 | + begin |
| 50 | + RestoreNVDAProfile(); |
| 51 | + end else begin |
| 52 | + MsgBox('未检测到配置备份文件,无法恢复!', mbCriticalError, MB_OK) |
| 53 | + end; |
| 54 | + Result := False; |
| 55 | +end; |
| 56 | +
|
| 57 | +[Files] |
| 58 | +Source: "Others\7z.dll"; DestDir: "{tmp}"; Flags: deleteafterinstall ignoreversion |
| 59 | +Source: "Others\7z.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall ignoreversion |
0 commit comments