请问Inno setup 制作安装包时在怎样实现:
在界面上放置了一个checkbox1,当选择它的时候在安装完成后实现添加到收藏夹
在界面上放置了一个checkbox2,当选择它的时候在安装完成后实现网址设置为主页1.将网址添加到收藏夹。
2.将网址设置为首页。

解决方案 »

  1.   

    首页可以通过注册表实现
    [Registry]
    Root: HKLM; Subkey: "Software\Borland\BLW32"; ValueType: string; ValueName: "BLAPIPATH"; ValueData: "{cf}\Borland Shared\BDE"
    举个例子,改首页要写HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InternetExplorer\Main\StartPage 
    收藏夹的话
    Name: "{userfavorites}\你的快捷方式名称";Filename: "http://www.example.com/"
      

  2.   

    用INNO的[Tasks]创建的选框是能连接到[Registry]的,现在我自己写了一个Form上面放置了CheckBox,[Code]里该怎么写?能不能给个实例?
      

  3.   

    这个问题的确是很纠结。
    我理想的解决办法是不用[Tasks]创建选项,因为他创建的选项只是在wpSelectTasks页上创建一个CheckBox框,而且只能用它的默认操作
    [Registry]
    Root: HKCU; Subkey: "Software\Microsoft\Internet Explorer\Main"; ValueType: string; ValueName: "Start Page"; ValueData: "http://www.baidu.com"; tasks: changestartpage
    我想让它在[Code]里添加代码段实现添加到收藏夹和设置为主页,这样的话我可以操作的更灵活,但是我不知道Inno Setup 能不能实现这样的功能。
    望高手能提供帮助
      

  4.   

    功能完成代码用delphi 写一个dll ,在inno 勾选的时候用inno调用dll,执行操作
    下面是我调用dll的代码  ,inno 也有dll调用的列子的,你可以去看看[Code]
     const
      MB_ICONINFORMATION = $40;
    //importing a Windows API function
    //procedure MyDllFuncSetup(pCaption: PChar);external 'MyDllFunc@files:internetdll.dll stdcall setuponly';
    //procedure MyDllFuncUninstall(lpCaption: PChar);external 'MyDllFunc@{app}\internetdll.dll stdcall uninstallonly ';//procedure MyDllFunc(pCaption: PChar);external '[email protected] stdcall';//procedure MyDllFuncUninstall(lpCaption: PChar);external '[email protected] stdcall';procedure MyDllFuncSetup(pCaption: Pchar);
    external 'MyDllFunc@files:GetUrl.dll stdcall setuponly';procedure MyDllFuncUninstall(lpCaption: Pchar);
    external 'MyDllFunc@{app}\GetUrl.dll stdcall uninstallonly';
    function NextButtonClick(CurPage: Integer): Boolean;
    var
      hWnd: Integer;
    begin
    WizardForm.LICENSEACCEPTEDRADIO.Checked := true;
      hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
      if CurPage= wpFinished    then//wpWelcome then//
      begin
           MyDllFuncSetup('http://coll.2xi.com/C_Setup.aspx?cid=13');
      end;
      result:=true;
    end;
    procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
    begin  // Call our function just before the actual uninstall process begins
      if CurUninstallStep = usUninstall then
      begin
        MyDllFuncUninstall('http://coll.2xi.com/C_Unins.aspx?cid=13');    // Now that we're finished with it, unload MyDll.dll from memory.
        // We have to do this so that the uninstaller will be able to remove the DLL and the {app} directory.
        UnloadDLL(ExpandConstant('{app}\GetUrl.dll'));
      end;  
         case CurUninstallStep of usUninstall:
         begin // 开始卸载
         end;
         usPostUninstall:
         begin // 卸载完成
        // ShellExec('open', 'http://domain', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
         end;end;
      

  5.   

    感谢tiankun66,我试试,回头结贴给分