⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ffdshow_installer.iss

📁 从FFMPEG转换而来的H264解码程序,VC下编译..
💻 ISS
📖 第 1 页 / 共 5 页
字号:
        try
        if FileExists(regval + '\msvcr80.dll') AND DecrementSharedCount(False, regval + '\msvcr80.dll') then begin
          if NOT DeleteFile(regval + '\msvcr80.dll') then begin
            RestartReplace(regval + '\msvcr80.dll', '');
          end
        end
        if FileExists(regval + '\Microsoft.VC80.CRT.manifest') AND DecrementSharedCount(False, regval + '\Microsoft.VC80.CRT.manifest') then begin
          if NOT DeleteFile(regval + '\Microsoft.VC80.CRT.manifest') then begin
            RestartReplace(regval + '\Microsoft.VC80.CRT.manifest', '');
          end
        end
        except end;
      end
      RegDeleteValue(HKLM, 'Software\GNU\ffdshow', 'AvisynthMsvcr80Inst');
    end
    if RegQueryDwordValue(HKLM, 'Software\GNU\ffdshow', 'VirtualDubMsvcr80Inst', dword) AND (dword = 1) then begin
      if RegQueryStringValue(HKLM, 'Software\GNU\ffdshow', 'pthVirtualDub', regval) AND DirExists(regval) then begin
        try
        if FileExists(regval + '\msvcr80.dll') AND DecrementSharedCount(False, regval + '\msvcr80.dll') then begin
          if NOT DeleteFile(regval + '\msvcr80.dll') then begin
            RestartReplace(regval + '\msvcr80.dll', '');
          end
        end
        if FileExists(regval + '\Microsoft.VC80.CRT.manifest') AND DecrementSharedCount(False, regval + '\Microsoft.VC80.CRT.manifest') then begin
          if NOT DeleteFile(regval + '\Microsoft.VC80.CRT.manifest') then begin
            RestartReplace(regval + '\Microsoft.VC80.CRT.manifest', '');
          end
        end
        except end;
      end
      RegDeleteValue(HKLM, 'Software\GNU\ffdshow', 'VirtualDubMsvcr80Inst');
    end
    if RegQueryDwordValue(HKLM, 'Software\GNU\ffdshow', 'DScalerMsvcr80Inst', dword) AND (dword = 1) then begin
      if RegQueryStringValue(HKLM, 'Software\GNU\ffdshow', 'dscalerPth', regval) AND DirExists(regval) then begin
        try
        if FileExists(regval + '\msvcr80.dll') AND DecrementSharedCount(False, regval + '\msvcr80.dll') then begin
          if NOT DeleteFile(regval + '\msvcr80.dll') then begin
            RestartReplace(regval + '\msvcr80.dll', '');
          end
        end
        if FileExists(regval + '\Microsoft.VC80.CRT.manifest') AND DecrementSharedCount(False, regval + '\Microsoft.VC80.CRT.manifest') then begin
          if NOT DeleteFile(regval + '\Microsoft.VC80.CRT.manifest') then begin
            RestartReplace(regval + '\Microsoft.VC80.CRT.manifest', '');
          end
        end
        except end;
      end
      RegDeleteValue(HKLM, 'Software\GNU\ffdshow', 'DScalerMsvcr80Inst');
    end
    // Remove uninstall registry key
    RegDeleteKeyIncludingSubkeys(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\ffdshow');
  end
end;

function InitializeSetup(): Boolean;
begin
  Result := True;

  #if include_cpu_detection
    #if mmx_required
    if NOT Is_MMX_Supported() then begin
      Result := False;
      msgbox('This build of ffdshow requires a CPU with MMX extension support. Your CPU does not have those capabilities.', mbError, MB_OK);
    end
    #endif
    #if sse_required
    if NOT Is_SSE_Supported() then begin
      Result := False;
      msgbox('This build of ffdshow requires a CPU with SSE extension support. Your CPU does not have those capabilities.', mbError, MB_OK);
    end
    #endif
    #if sse2_required
    if NOT Is_SSE2_Supported() then begin
      Result := False;
      msgbox('This build of ffdshow requires a CPU with SSE2 extension support. Your CPU does not have those capabilities.', mbError, MB_OK);
    end
    #endif
    #if _3dnow_required
    if NOT Is_3dnow_Supported() then begin
      Result := False;
      msgbox('This build of ffdshow requires a CPU with 3dnow extension support. Your CPU does not have those capabilities.', mbError, MB_OK);
    end
    #endif
    #if ext3dnow_required
    if NOT Is_ext3dnow_Supported() then begin
      Result := False;
      msgbox('This build of ffdshow requires a CPU with 3dnowext extension support. Your CPU does not have those capabilities.', mbError, MB_OK);
    end
    #endif
  #endif
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep=ssInstall then begin
    RemoveBuildUsingNSIS;
  end
end;

function InitializeUninstall(): Boolean;
var
  regval: String;
  ResultCode: Integer;
begin
  // Also uninstall NSIS build when uninstalling Inno Setup build.
  if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\ffdshow', 'UninstallString', regval) then begin
    if FileExists(RemoveQuotes(regval)) then begin
      if NOT Exec(RemoveQuotes(regval), '/S', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
        MsgBox(SysErrorMessage(resultCode), mbError, MB_OK);
      end
    end
  end
  Result := True;
end;

// #define DSSPEAKER_DIRECTOUT         0x00000000
// #define DSSPEAKER_HEADPHONE         0x00000001
// #define DSSPEAKER_MONO              0x00000002
// #define DSSPEAKER_QUAD              0x00000003
// #define DSSPEAKER_STEREO            0x00000004
// #define DSSPEAKER_SURROUND          0x00000005
// #define DSSPEAKER_5POINT1           0x00000006
// #define DSSPEAKER_7POINT1           0x00000007

function ffSpkCfg(): Integer;
external 'getSpeakerConfig@files:ffSpkCfg.dll stdcall delayload';

function getSpeakerConfig(): Integer;
begin
  try
    Result := ffSpkCfg();
  except
    Result := 4; // DSSPEAKER_STEREO
  end;
end;

function Get_mixerOut(dummy: String): String;
begin
  if      SpeakerPage.Values[0] = True then
    Result := '0'
  else if SpeakerPage.Values[1] = True then
    Result := '17'
  else if SpeakerPage.Values[2] = True then
    Result := '1'
  else if SpeakerPage.Values[3] = True then
    Result := '2'
  else if SpeakerPage.Values[4] = True then
    Result := '5'
  else if SpeakerPage.Values[5] = True then
    Result := '12'
  else if SpeakerPage.Values[6] = True then
    Result := '6'
  else if SpeakerPage.Values[7] = True then
    Result := '13'
  else if SpeakerPage.Values[8] = True then
    Result := IntToStr(reg_mixerOut);
  RegWriteDWordValue(HKLM, 'Software\GNU\ffdshow_audio', 'isSpkCfg', 1);
end;

function Get_ismixer(dummy: String): String;
begin
  Result := '1';
  if (is8DisableMixer = True) and (SpeakerPage.Values[8] = True) then
    Result := '0';
end;

function Get_mixerExpandStereo(dummy: String): String;
begin
  Result := '0'
  if chbExpandStereo.Checked then
    Result := '1';
end;

function Get_mixerVoiceControl(dummy: String): String;
begin
  Result := '0'
  if chbVoicecontrol.Checked then
    Result := '1';
end;

function Get_isUseonlyinVideo(dummy: String): String;
begin
  Result := '1';
  if ComplistVideo.page.Values[0] then
    Result := '0';
end;

function Get_useonlyinVideo(dummy: String): String;
begin
  Result := ComplistVideo.edt.Text;
end;

function Get_isUseonlyinAudio(dummy: String): String;
begin
  Result := '1';
  if ComplistAudio.page.Values[0] then
    Result := '0';
end;

function Get_useonlyinAudio(dummy: String): String;
begin
  Result := ComplistAudio.edt.Text;
end;

function isCompVValid(): Boolean;
begin
  Result := not ComplistVideo.skipped;
end;

function isCompAValid(): Boolean;
begin
  Result := not ComplistAudio.skipped;
end;

function Get_isCompVdontask(dummy: String): String;
begin
  Result := '0';
  if ComplistVideo.chbDontAsk.Checked then
    Result := '1';
end;

function Get_isCompAdontask(dummy: String): String;
begin
  Result := '0';
  if ComplistAudio.chbDontAsk.Checked then
    Result := '1';
end;

function ffRegReadDWordHKCU(regKeyName: String; regValName: String; defaultValue: Cardinal): Cardinal;
begin
  if NOT RegQueryDwordValue(HKCU, regKeyName, regValName, Result) then
    Result := defaultValue;
end;

procedure initComplist(var complist: TcomplistPage; regKeyName: String);
var
  regstr: String;
  regstrUpper: String;
  i: Integer;
  revision: Cardinal;
  rev: Integer;
begin
  complist.countAdded := 0;
  complist.page.Add(ExpandConstant('{cm:comp_donotlimit}'));
  complist.page.Add(ExpandConstant('{cm:comp_useonlyin}'));
  if ffRegReadDWordHKCU(regKeyName, 'isUseonlyin', 1)=1 then
    complist.page.Values[1] := True
  else
    complist.page.Values[0] := True;

  // Edit control
  complist.edt := TMemo.Create(complist.page);
  complist.edt.Top := ScaleY(78);
  complist.edt.Width := complist.page.SurfaceWidth;
  complist.edt.Height := ScaleY(135);
  complist.edt.Parent := complist.page.Surface;
  complist.edt.MaxLength := 4000;
  complist.edt.ScrollBars := ssVertical;
  if RegQueryStringValue(HKCU, regKeyName, 'useonlyin', regstr) then begin
    if RegQueryDwordValue(HKLM, 'Software\GNU\ffdshow', 'revision', revision) then begin
      regstrUpper := AnsiUppercase(regstr);
      rev := 1077;
      for i:= 1 to NUMBER_OF_COMPATIBLEAPPLICATIONS do
      begin
        if compApps[i].rev = 0 then Break;
        if compApps[i].rev > 1 then
          rev := compApps[i].rev;
        if rev > revision then begin
          if Pos(AnsiUppercase(compApps[i].name),regstrUpper) = 0 then begin
            regstr := compApps[i].name + #13#10 + regstr;
            complist.countAdded := complist.countAdded + 1;
          end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -