Example #1
0
        //procedure InitializeWizard;
        //var
        //    InputQueryWizardPage: TInputQueryWizardPage;
        //    InputOptionWizardPage: TInputOptionWizardPage;
        //    InputDirWizardPage: TInputDirWizardPage;
        //    InputFileWizardPage: TInputFileWizardPage;
        //    OutputMsgWizardPage: TOutputMsgWizardPage;
        //    OutputMsgMemoWizardPage: TOutputMsgMemoWizardPage;
        //    AfterID: Integer;
        //begin
        //    WizardForm.PasswordEdit.Text := '{#Password}';
        //
        //    AfterID := wpSelectTasks;
        //
        //    AfterID := CreateCustomPage(AfterID, 'CreateCustomPage', 'ADescription').ID;
        //
        //    InputQueryWizardPage := CreateInputQueryPage(AfterID, 'CreateInputQueryPage', 'ADescription', 'ASubCaption');
        //    InputQueryWizardPage.Add('&APrompt:', False);
        //    AfterID := InputQueryWizardPage.ID;
        //
        //    InputOptionWizardPage := CreateInputOptionPage(AfterID, 'CreateInputOptionPage', 'ADescription', 'ASubCaption', False, False);
        //    InputOptionWizardPage.Add('&AOption');
        //    AfterID := InputOptionWizardPage.ID;
        //
        //    InputDirWizardPage := CreateInputDirPage(AfterID, 'CreateInputDirPage', 'ADescription', 'ASubCaption', False, 'ANewFolderName');
        //    InputDirWizardPage.Add('&APrompt:');
        //    InputDirWizardPage.Values[0] := 'C:\';
        //    AfterID := InputDirWizardPage.ID;
        //
        //    InputFileWizardPage := CreateInputFilePage(AfterID, 'CreateInputFilePage', 'ADescription', 'ASubCaption');
        //    InputFileWizardPage.Add('&APrompt:', 'Executable files|*.exe|All files|*.*', '.exe');
        //    AfterID := InputFileWizardPage.ID;
        //
        //    OutputMsgWizardPage := CreateOutputMsgPage(AfterID, 'CreateOutputMsgPage', 'ADescription', 'AMsg');
        //    AfterID := OutputMsgWizardPage.ID;
        //
        //    OutputMsgMemoWizardPage := CreateOutputMsgMemoPage(AfterID, 'CreateOutputMsgMemoPage', 'ADescription', 'ASubCaption', 'AMsg');
        //    AfterID := OutputMsgMemoWizardPage.ID;
        //
        //    OutputProgressWizardPage := CreateOutputProgressPage('CreateOutputProgressPage', 'ADescription');
        //    OutputProgressWizardPageAfterID := AfterID;
        //end;
        public override void InitializeWizard()
        {
            WizardForm.PasswordEdit.Text = _password;
            var AfterID = PageID.SelectTasks;

            AfterID = CreateCustomPage(AfterID, "CreateCustomPage", "ADescription").ID;

            var InputQueryWizardPage = CreateInputQueryPage(AfterID, "CreateInputQueryPage", "ADescription", "ASubCaption");

            InputQueryWizardPage.Add("&APrompt:", false);
            AfterID = InputQueryWizardPage.ID;

            var InputOptionWizardPage = CreateInputOptionPage(AfterID, "CreateInputOptionPage", "ADescription", "ASubCaption", false, false);

            InputOptionWizardPage.Add("&AOption");
            AfterID = InputOptionWizardPage.ID;

            var InputDirWizardPage = CreateInputDirPage(AfterID, "CreateInputDirPage", "ADescription", "ASubCaption", false, "ANewFolderName");

            InputDirWizardPage.Add("&APrompt:");
            InputDirWizardPage.Values[0] = "C:\\";
            AfterID = InputDirWizardPage.ID;

            var InputFileWizardPage = CreateInputFilePage(AfterID, "CreateInputFilePage", "ADescription", "ASubCaption");

            InputFileWizardPage.Add("&APrompt:", "Executable files|*.exe|All files|*.*", ".exe");
            AfterID = InputFileWizardPage.ID;

            var OutputMsgWizardPage = CreateOutputMsgPage(AfterID, "CreateOutputMsgPage", "ADescription", "AMsg");

            AfterID = OutputMsgWizardPage.ID;

            var OutputMsgMemoWizardPage = CreateOutputMsgMemoPage(AfterID, "CreateOutputMsgMemoPage", "ADescription", "ASubCaption", "AMsg");

            AfterID = OutputMsgMemoWizardPage.ID;

            OutputProgressWizardPage        = CreateOutputProgressPage("CreateOutputProgressPage", "ADescription");
            OutputProgressWizardPageAfterID = AfterID;
        }
Example #2
0
        //procedure InitializeWizard;
        //begin
        //    { Create the pages }

        //    UserPage := CreateInputQueryPage(wpWelcome,
        //        'Personal Information', 'Who are you?',
        //        'Please specify your name and the company for whom you work, then click Next.');
        //    UserPage.Add('Name:', False);
        //    UserPage.Add('Company:', False);

        //    UsagePage := CreateInputOptionPage(UserPage.ID,
        //        'Personal Information', 'How will you use My Program?',
        //        'Please specify how you would like to use My Program, then click Next.',
        //        True, False);
        //    UsagePage.Add('Light mode (no ads, limited functionality)');
        //    UsagePage.Add('Sponsored mode (with ads, full functionality)');
        //    UsagePage.Add('Paid mode (no ads, full functionality)');

        //    LightMsgPage := CreateOutputMsgPage(UsagePage.ID,
        //        'Personal Information', 'How will you use My Program?',
        //        'Note: to enjoy all features My Program can offer and to support its development, ' +
        //        'you can switch to sponsored or paid mode at any time by selecting ''Usage Mode'' ' +
        //        'in the ''Help'' menu of My Program after the installation has completed.'#13#13 +
        //        'Click Back if you want to change your usage mode setting now, or click Next to ' +
        //        'continue with the installation.');

        //    KeyPage := CreateInputQueryPage(UsagePage.ID,
        //        'Personal Information', 'What''s your registration key?',
        //        'Please specify your registration key and click Next to continue. If you don''t ' +
        //        'have a valid registration key, click Back to choose a different usage mode.');
        //    KeyPage.Add('Registration key:', False);

        //    ProgressPage := CreateOutputProgressPage('Personal Information', 'What''s your registration key?');

        //    DataDirPage := CreateInputDirPage(wpSelectDir,
        //        'Select Personal Data Directory', 'Where should personal data files be installed?',
        //        'Select the folder in which Setup should install personal data files, then click Next.',
        //        False, '');
        //    DataDirPage.Add('');

        //    { Set default values, using settings that were stored last time if possible }

        //    UserPage.Values[0] := GetPreviousData('Name', ExpandConstant('{sysuserinfoname}'));
        //    UserPage.Values[1] := GetPreviousData('Company', ExpandConstant('{sysuserinfoorg}'));

        //    case GetPreviousData('UsageMode', '') of
        //        'light': UsagePage.SelectedValueIndex := 0;
        //        'sponsored': UsagePage.SelectedValueIndex := 1;
        //        'paid': UsagePage.SelectedValueIndex := 2;
        //    else
        //        UsagePage.SelectedValueIndex := 1;
        //    end;

        //    DataDirPage.Values[0] := GetPreviousData('DataDir', '');
        //end;
        public override void InitializeWizard()
        {
            // Create the pages

            UserPage = CreateInputQueryPage(
                PageID.Welcome,
                "Personal Information",
                "Who are you?",
                "Please specify your name and the company for whom you work, then click Next.");
            UserPage.Add("Name:", false);
            UserPage.Add("Company:", false);

            UsagePage = CreateInputOptionPage(UserPage.ID,
                                              "Personal Information", "How will you use My Program?",
                                              "Please specify how you would like to use My Program, then click Next.",
                                              true, false);
            UsagePage.Add("Light mode (no ads, limited functionality)");
            UsagePage.Add("Sponsored mode (with ads, full functionality)");
            UsagePage.Add("Paid mode (no ads, full functionality)");

            LightMsgPage = CreateOutputMsgPage(UsagePage.ID,
                                               "Personal Information", "How will you use My Program?",
                                               "Note: to enjoy all features My Program can offer and to support its development, " +
                                               "you can switch to sponsored or paid mode at any time by selecting 'Usage Mode' " +
                                               "in the 'Help' menu of My Program after the installation has completed.\r\r" +
                                               "Click Back if you want to change your usage mode setting now, or click Next to " +
                                               "continue with the installation.");

            KeyPage = CreateInputQueryPage(UsagePage.ID,
                                           "Personal Information", "What's your registration key?",
                                           "Please specify your registration key and click Next to continue. If you don't " +
                                           "have a valid registration key, click Back to choose a different usage mode.");
            KeyPage.Add("Registration key:", false);

            ProgressPage = CreateOutputProgressPage("Personal Information", "What's your registration key?");

            DataDirPage = CreateInputDirPage(PageID.SelectDir,
                                             "Select Personal Data Directory", "Where should personal data files be installed?",
                                             "Select the folder in which Setup should install personal data files, then click Next.",
                                             false, "");

            DataDirPage.Add("");

            // Set default values, using settings that were stored last time if possible

            UserPage.Values[0] = GetPreviousData("Name", ExpandConstant(__sysuserinfoname));
            UserPage.Values[1] = GetPreviousData("Company", ExpandConstant(__sysuserinfoorg));

            switch (GetPreviousData("UsageMode", ""))
            {
            case "light":
                UsagePage.SelectedValueIndex = 0;
                break;

            case "sponsored":
                UsagePage.SelectedValueIndex = 1;
                break;

            case "paid":
                UsagePage.SelectedValueIndex = 2;
                break;

            default:
                UsagePage.SelectedValueIndex = 1;
                break;
            }

            DataDirPage.Values[0] = GetPreviousData("DataDir", "");
        }