这是用于静默安装MySQL的脚本。这是我提起文件名后遇到的错误。请帮助我解决这个问题。
[Setup]
AppId={{10943279-F8A1-4B36-8505-8C366B1CE577}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=C:\Users\DIVYA\Desktop
OutputBaseFilename=DBInstallationsetup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Users\DIVYA\Desktop\DBInstall.exe"; DestDir: "{temp}"; Flags: ignoreversion
Source: "I:\demo\mysql-installer-community-8.0.12.0.msi"; DestDir: "{temp}"; Flags: ignoreversion
Source: "I:\demo\vcredist_x64.exe"; DestDir: "{temp}"; Flags: ignoreversion
Source: "C:\Program Files\Java\jre1.8.0_181\*"; DestDir: "{temp}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "D:\database.sql"; DestDir: "{temp}"; Flags: ignoreversion
[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
;安装MySQL安装包,默认情况下转到C:\ Program Files \ MySQL \ ; / qn还可以使msiexec安静无人值守。 档名:msiexec.exe;参数:“ /i""{tmp}\mysql-installer-community-8.0.12.0.msi”“ / qn”; StatusMsg:解压缩Mysql 8.0.12.0安装; 标记:runhidden
Filename: "C:\Program Files(x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe";
Parameters: " --action=install -t=Custom --config=mysql-server-8.0- win32:passwd=password --product=mysql-server-8.0-win32 --catalog=mysql-8.0-win32 --nowait";
StatusMsg: Installing MySQL Server;
Flags: runhidden
; Quite self explanatory, we just add mysql service to services currently running on the pc
Filename: "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe"; Parameters:" --install";
WorkingDir: {app};
StatusMsg: Installing MySQL Service;
Flags: runhidden
; Starting the service
Filename: net.exe;
Parameters: start mysql;
StatusMsg: Starting MySQL Server;
Flags: runhidden
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
谢谢。