4

我有这个 InnoSetup 做的自动脚本:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId=
AppName=VideoScreenRecorder
AppVersion=1.5
;AppVerName=VideoScreenRecorder 1.5
AppPublisher=Daniel Lipman
DefaultDirName={pf}\VideoScreenRecorder
DefaultGroupName=VideoScreenRecorder
InfoBeforeFile=D:\ScreenVideoRecorderHelp.txt
OutputDir=D:\ScreenVideoRecorderCompiler
OutputBaseFilename=Setup
SetupIconFile=D:\Activity Monitor.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "D:\C-Sharp\ScreenVideoRecorder\ScreenVideoRecorderWorkingVersion\bin\Debug\ScreenVideoRecorder.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\VideoScreenRecorder"; Filename: "{app}\ScreenVideoRecorder.exe"
Name: "{commondesktop}\VideoScreenRecorder"; Filename: "{app}\ScreenVideoRecorder.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\ScreenVideoRecorder.exe"; Description: "{cm:LaunchProgram,VideoScreenRecorder}"; Flags: nowait postinstall skipifsilent

安装获取exe文件VideoScreenRecorder并将其复制安装在程序文件目录中...等

我想要做的是在安装中添加另一个 exe 文件:ffmpeg.exe 我希望安装程序将在特定位置创建一个目录,例如 c:\test 并将 ffmpeg.exe 放在该目录中。

主 exe 文件是 VideoScreenRecorder.exe 但我还需要将 ffmpeg.exe 复制到另一个特定目录。

ffmpeg.exe 应该在的目录是:

C:\Users\用户名\AppData\Local\ScreenVideoRecorder\ScreenVideoRecorder\workingDirectory 我需要安装目录在这个地方创建目录,然后将ffmpeg.exe复制到workingDirectory。

我该怎么做 ?

4

1 回答 1

5

你可以DestDir为每个文件制作任何你喜欢的东西,在这种情况下,使用Inno Setup 实现的常量之一。

[Files]
Source: "X:\PathToFFMPEGSource\ffmpeg.exe"; 
DestDir: "{localappdata}\ScreenVideoRecorder\ScreenVideoRecorder\workingDirectory"; 
Flags: ignoreversion

*其中 X 是您的源 ffmpeg.exe 所在的驱动器号。

于 2013-06-09T10:26:09.797 回答