📄 ffdshow_installer.iss
字号:
Root: HKCU; Subkey: Software\GNU\ffdshow; ValueType: dword; ValueName: isBlacklist; ValueData: 1; Flags: createvalueifdoesntexist; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow; ValueType: String; ValueName: blacklist; ValueData: "explorer.exe;oblivion.exe;morrowind.exe;"; Flags: createvalueifdoesntexist; OnlyBelowVersion: 0,6; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow; ValueType: String; ValueName: blacklist; ValueData: "oblivion.exe;morrowind.exe;"; Flags: createvalueifdoesntexist; MinVersion: 0,6; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow_audio; ValueType: dword; ValueName: isBlacklist; ValueData: 1; Flags: createvalueifdoesntexist; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow_audio; ValueType: String; ValueName: blacklist; ValueData: "explorer.exe;oblivion.exe;morrowind.exe"; Flags: createvalueifdoesntexist; OnlyBelowVersion: 0,6; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow_audio; ValueType: String; ValueName: blacklist; ValueData: "oblivion.exe;morrowind.exe"; Flags: createvalueifdoesntexist; MinVersion: 0,6; Components: ffdshow
; Compatibility list
Root: HKCU; Subkey: Software\GNU\ffdshow; ValueType: dword; ValueName: isUseonlyin; ValueData: {code:Get_isUseonlyinVideo}; Check: IsCompVValid; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow; ValueType: String; ValueName: useonlyin; ValueData: {code:Get_useonlyinVideo}; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow_audio; ValueType: dword; ValueName: isUseonlyin; ValueData: {code:Get_isUseonlyinAudio}; Check: IsCompAValid; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow_audio; ValueType: String; ValueName: useonlyin; ValueData: {code:Get_useonlyinAudio}; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow; ValueType: dword; ValueName: dontaskComp; ValueData: {code:Get_isCompVdontask}; Check: IsCompVValid; Components: ffdshow
Root: HKCU; Subkey: Software\GNU\ffdshow_audio; ValueType: dword; ValueName: dontaskComp; ValueData: {code:Get_isCompAdontask}; Check: IsCompAValid; Components: ffdshow
; Registry keys for the audio/video formats:
#include "reg_formats.iss"
[INI]
#if !unicode_required
Filename: {win}\system.ini; Section: drivers32; Key: vidc.ffds; String: ff_vfw.dll; Flags: uninsdeleteentry; MinVersion: 4,0; Components: ffdshow\vfw
#if include_makeavis
Filename: {win}\system.ini; Section: drivers32; Key: msacm.avis; String: ff_acm.acm; Flags: uninsdeleteentry; MinVersion: 4,0; Components: ffdshow\makeavis
#endif
#endif
[Run]
Description: {cm:runaudioconfig}; Filename: rundll32.exe; Parameters: ffdshow.ax,configureAudio; WorkingDir: {app}; Flags: postinstall nowait unchecked; Components: ffdshow
Description: {cm:runvideoconfig}; Filename: rundll32.exe; Parameters: ffdshow.ax,configure; WorkingDir: {app}; Flags: postinstall nowait unchecked; Components: ffdshow
#if is64bit
Description: {cm:runvfwconfig}; Filename: rundll32.exe; Parameters: ff_vfw.dll,configureVFW; WorkingDir: {app}; Flags: postinstall nowait unchecked; Components: ffdshow\vfw
#else
Description: {cm:runvfwconfig}; Filename: rundll32.exe; Parameters: ff_vfw.dll,configureVFW; Flags: postinstall nowait unchecked; Components: ffdshow\vfw
#endif
; All custom strings in the installer:
#include "custom_messages.iss"
[Code]
const NUMBER_OF_COMPATIBLEAPPLICATIONS=150;
type
TCompApp = record
rev: Integer; // The application (name) have been added to the compatibility list at this rev.
name: String;
end;
TcomplistPage = record
page: TInputOptionWizardPage;
edt: TMemo;
chbDontAsk: TCheckBox;
skipped: Boolean;
countAdded: Integer;
end;
// Global vars
var
reg_mixerOut: Cardinal;
reg_ismixer: Cardinal;
ComplistVideo: TcomplistPage;
ComplistAudio: TcomplistPage;
Complist_isMsgAddedShown: Boolean;
SpeakerPage: TInputOptionWizardPage;
chbVoicecontrol: TCheckBox;
chbExpandStereo: TCheckBox;
is8DisableMixer: Boolean;
priorPageID: Integer; // to be used "Don't ask me again" in compatibility list, so that audio and video config can link.
compApps : array[1..NUMBER_OF_COMPATIBLEAPPLICATIONS] of TCompApp;
function CheckTaskVideo(name: String; value: Integer; showbydefault: Boolean): Boolean;
var
regval: Cardinal;
begin
Result := False;
if RegQueryDwordValue(HKCU, 'Software\GNU\ffdshow', name, regval) then begin
Result := (regval = value);
end
else begin
if RegQueryDwordValue(HKLM, 'Software\GNU\ffdshow', name, regval) then begin
Result := (regval = value);
end
else begin
Result := showbydefault;
end
end
end;
function CheckTaskVideo2(name: String; showbydefault: Boolean): Boolean;
var
regval: Cardinal;
begin
Result := False;
if RegQueryDwordValue(HKCU, 'Software\GNU\ffdshow', name, regval) then begin
Result := (regval > 0);
end
else begin
if RegQueryDwordValue(HKLM, 'Software\GNU\ffdshow', name, regval) then begin
Result := (regval > 0);
end
else begin
Result := showbydefault;
end
end
end;
function CheckTaskAudio(name: String; value: Integer; showbydefault: Boolean): Boolean;
var
regval: Cardinal;
begin
Result := False;
if RegQueryDwordValue(HKCU, 'Software\GNU\ffdshow_audio', name, regval) then begin
Result := (regval = value);
end
else begin
if RegQueryDwordValue(HKLM, 'Software\GNU\ffdshow_audio', name, regval) then begin
Result := (regval = value);
end
else begin
Result := showbydefault;
end
end
end;
function CheckTaskVideoInpreset(name: String; value: Integer; showbydefault: Boolean): Boolean;
var
regval: Cardinal;
begin
Result := False;
if RegQueryDwordValue(HKCU, 'Software\GNU\ffdshow\default', name, regval) then
Result := (regval = value)
else
Result := showbydefault;
end;
function CheckTaskAudioInpreset(name: String; value: Integer; showbydefault: Boolean): Boolean;
var
regval: Cardinal;
begin
Result := False;
if RegQueryDwordValue(HKCU, 'Software\GNU\ffdshow_audio\default', name, regval) then
Result := (regval = value)
else
Result := showbydefault;
end;
function CheckModernIcon(): Boolean;
var
regVal: Cardinal;
begin
Result := True;
if RegQueryDwordValue(HKCU, 'Software\GNU\ffdshow', 'trayIconType', regVal) AND (regVal = 2) then begin
Result := False;
end
end;
function GetTaskVolNormalize(): Boolean;
begin
Result := False;
if CheckTaskAudioInpreset('isvolume', 1, False) then
if CheckTaskAudioInpreset('volNormalize', 1, False) then
Result := True;
end;
#if is64bit
function GetVFWLocation(dummy: String): String;
begin
Result := GetShortName(ExpandConstant('{app}\ff_vfw.dll'));
end;
#endif
#if include_app_plugins
// Global vars
var
avisynthplugindir: String;
dscalerdir: String;
VdubDirPage: TInputDirWizardPage;
function GetAviSynthPluginDir(dummy: String): String;
begin
if Length(avisynthplugindir) = 0 then begin
if NOT RegQueryStringValue(HKLM, 'Software\AviSynth', 'plugindir2_5', avisynthplugindir) OR NOT DirExists(avisynthplugindir) then begin
if NOT RegQueryStringValue(HKLM, 'Software\AviSynth', 'plugindir', avisynthplugindir) OR NOT DirExists(avisynthplugindir) then begin
avisynthplugindir := ExpandConstant('{app}');
end
end
end
Result := avisynthplugindir;
end;
function GetDScalerDir(dummy: String): String;
var
proglist: Array of String;
i: Integer;
temp : String;
begin
if Length(dscalerdir) = 0 then begin
dscalerdir := ExpandConstant('{app}');
if RegGetSubkeyNames(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall', proglist) then begin
for i:=0 to (GetArrayLength(proglist) - 1) do begin
if Pos('dscaler', Lowercase(proglist[i])) > 0 then begin
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\' + proglist[i], 'Inno Setup: App Path', temp) AND DirExists(temp) then begin
dscalerdir := temp;
Break;
end
end
end
end
end
Result := dscalerdir;
end;
function GetVdubPluginDir(dummy: String): String;
begin
Result := VdubDirPage.Values[0];
end;
#endif
function GetDefaultInstallDir(dummy: String): String;
begin
if NOT RegQueryStringValue(HKLM, 'Software\GNU\ffdshow', 'pth', Result) OR (Length(Result) = 0) then begin
Result := ExpandConstant('{pf}\ffdshow');
end
end;
function IsUpdate(): Boolean;
begin
Result := FileExists(GetDefaultInstallDir('') + '\libavcodec.dll');
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if CurPageID = wpSelectComponents then begin
if NOT IsComponentSelected('ffdshow') then begin
msgbox('You must select at least one component.', mbInformation, MB_OK);
Result := False;
end
end
if CurPageID = ComplistVideo.page.ID then begin
ComplistAudio.chbDontAsk.Checked := ComplistVideo.chbDontAsk.Checked;
end
end;
function BackButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if CurPageID = ComplistAudio.page.ID then begin
ComplistVideo.chbDontAsk.Checked := ComplistAudio.chbDontAsk.Checked;
end
end;
procedure RemoveBuildUsingNSIS();
var
regval: String;
dword: Cardinal;
begin
if RegKeyExists(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\ffdshow') then begin
// Remove uninstall.exe
if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\ffdshow', 'UninstallString', regval) then begin
if FileExists(RemoveQuotes(regval)) then begin
DeleteFile(RemoveQuotes(regval));
end
regval := ExtractFilePath(RemoveQuotes(regval));
// ToDo: Also remove ffdshow files if new install path is different from old one.
end
// Remove MSVC80 runtimes
if RegQueryDwordValue(HKLM, 'Software\GNU\ffdshow', 'AvisynthMsvcr80Inst', dword) AND (dword = 1) then begin
if RegQueryStringValue(HKLM, 'Software\GNU\ffdshow', 'pthAvisynth', regval) AND DirExists(regval) then begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -