Jump to content

[RELz] Mertz's WizBAIN thread


Beermotor

Recommended Posts

Thank you. I'm swigging from the Earth version of such a potion right now, courtesy of some Trappist monks in Belgium. ;)

So for the font5 check,  unfortunately a comparable function in WizBAIN was never implemented (see the Wrye Bash Technical ReadMe OMOD section for more detail). There is however the ability to get a filename out of the Data folder, called " GetFilename " (and GetFolder ) which I've never used, but I think Metallicow had an example of how to use it in his Demo Wizard so I could probably figure it out quickly. 

The big caveat to going that route that is while checking to see if the font is present in the Data folder doesn't mean it is being used,  so we could also check for something that proves the existence of Phinix being installed. That's probably the best we'll be able to do, unless @alt3rn1ty knows of some arcane wizardry that will do the trick.

Disclaimer: I didn't even know Phinix was a thing until today. :P  I always used DarNified vanillla and didn't use DarkUI until just now.

I'm kind of over the crud now, but I need to help Utumno out some Bash work done first before I can finish up the wizard. I'll do my best to get everything rolled up this week.

 

Link to comment
Share on other sites

If you like, the descriptions can be added from the rtfs and some pictures etc. added, else it's all yours!

The "Vanilla.rtf" isn't referenced in the script.

Quote

For vanilla Oblivion. Choose this option if you don't have any of the book mods in the other selections

Book mods?

All the images are referenced from the script. Except for font 1. We'd have to make something up for them.

There's no problem with a space in the image file name any more? Think Utumno fixed it.

IIRC it's "Docs" not "Documentation". :P

Yoops... with the images taking up a lot of bytes here's hoping the recipient bandwidth supports!

Is that the structure you want? It might want to be jiggled around some for better effect.

 

All the planetelderscrolls links for font generation support etc are dead. Will leave them in as they can be mass replaced by some new ones? Perhaps we can help?

DarnTest.7z

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

On 10/31/2017 at 12:11 AM, lmstearn said:

My apologies for the delay. Domestic responsibilities.

However I rise at 3:00AM each day so I've had some time this morning to merge our work together. You did a fine job on everything, thank you for helping me and I've given you equal credit because I couldn't have done this one without you.

https://drive.google.com/open?id=1a-KrfcB5CbgQ0unGny_DWeY5oVladDxg

Note there are two files here: one is a BCF which requires the original mod, the other is basically a repacked version of the mod. I would trust the BCF above the other, but I was kind of surprised that the original mod was 30MB and the new one with smaller images is 4MB. 

Changes:

  • Merged in the images I re-compressed in Photoshop CC 2018.
  • Merged in the welcome screen from the original wizard, gave Uncle lmstearn credit. :)
  • Adjusted the image paths to the wizard images folder.
  • A few bug fixes here and there.
  • Expanded some of the heading descriptions

Give it a whirl ladies and gents, and let me know if you run into anything squirrelly. There may be a few weird things in the Welcome screen text-wise and I know the note at the end isn't displaying properly. I remembered that as I was typing this. Ugh. Anyway I wanted to get something up so you all wouldn't think I was dead.

  • Like 3
Link to comment
Share on other sites

I gave both the BCF and repacked versions a try. Both have seemingly installed correctly but when attempting to start the game, both crash at the Bethesda logo.

The uninstall process removes Map loop.bik and Oblivion iv logo.bik. If that is a bug from the original or your attempts or an incompatibility with Bash and .bik files, I do not know. Hopefully whatevers wrong can be fixed. :)

Link to comment
Share on other sites

Oh dear. All the ini tweaks were applied after the BAIN install? It might be worth taking a snapshot of Oblivion.ini before and after.

Did all the nominated files actually get installed I wonder?

@Beermotor: There's a "menus - Shortcut.lnk" in 000 core\textures\menus\. Did I put that there?

Link to comment
Share on other sites

5 hours ago, Sladen2019 said:

I gave both the BCF and repacked versions a try. Both have seemingly installed correctly but when attempting to start the game, both crash at the Bethesda logo.

The uninstall process removes Map loop.bik and Oblivion iv logo.bik. If that is a bug from the original or your attempts or an incompatibility with Bash and .bik files, I do not know. Hopefully whatevers wrong can be fixed. :)

I tested an uninstall and got the same result which helped me figure out what it was: the DarkUId overwrites the stock .bik files but since they're stock Oblivion files, the only way to get them back is to reinstall them via "verify game integrity". I'm pretty sure Bash can't manage stock files that get clobbered by a mod, but then again mods should never, ever overwrite stock Bethesda files, and this one does exactly that. :facepalm:

This is kind of like someone making a mod and naming one of the files "DLCMehrunesRazor.esp". It's irresponsible and the end-user can't uninstall it without it breaking their game. 

I've never tested DarkUId without including those .bik files, but I'm thinking strongly about excluding them from the package if it won't break anything.  Worst case scenario I add a warning screen on the second step that says "you cannot uninstall this mod without reinstalling these .bik video files: are you sure you want to continue? Yes/No".

 

1 hour ago, lmstearn said:

Oh dear. All the ini tweaks were applied after the BAIN install? It might be worth taking a snapshot of Oblivion.ini before and after.

Did all the nominated files actually get installed I wonder?

@Beermotor: There's a "menus - Shortcut.lnk" in 000 core\textures\menus\. Did I put that there?

If our wizard was used only the ini tweak selected should be installed. I tested and got only the desired single INI tweak, but the tweak for the specific font I picked isn't working right. I'll have to take another QC pass at the EditINI sections. They look correct but one character being off could make Bash testy.

As for the shortcut link, yes, but I didn't see it either. The "package for release" tool is supposed to skip shortcut .lnk files, or so I thought. I removed it from my copy so it should be fine now.

 

I'm going to do some testing to A.) see if the mod will function OK without the video files, and B.) to figure out what Bash doesn't like about the ini tweaks added via EditINI.  Should be fairly quick.

 

 

  • Like 2
Link to comment
Share on other sites

ok I've got a new build ready but I've run into a problem with the font ini tweaks that has me completely vexed. 

Since each font uses a common font "DarN_Oblivion_28.fnt", I put that in the core package (as it was with the original mod) and just install each font by itself with an ini tweak. So the meat of it is functioning properly: you pick the "Roosevelt" font, you get the font and the ini tweak for it.

The problem I'm encountering is with the ini tweak itself: it is orange will not apply.

Here's the reason Bash doesn't like it:

DarkUId Custom Font 1 - Kingthings Exeter.ini:
 Format mismatch:
  Target format: Batch Script
  Tweak format: INI

The thing is, under @alt3rn1ty's package, this same exact tweak file installs and applies just fine so I'm stumped.

Edit: Looks like it isn't necessarily these tweaks: ALL of my tweaks have errors apparently:

WB-bad-tweaks.thumb.JPG.c18b064dc381a844cf178ba1fbc67ab6.JPG

Link to comment
Share on other sites

An ini is just one big string. It's not parsing the ini correctly then:

Quote

EditINI('Oblivion.ini', 'Fonts', 'SFontFile_1', 'Data\\Fonts\\DarN_Kingthings_Exeter_28.fnt')

WB is creating an Exeter.ini file?? Do the tweaks still appear orange when Darkui is uninstalled?

Edit: Also another error- doubled a ".fnt"

Quote

 EditINI('Oblivion.ini', 'Fonts', 'SFontFile_1', 'Data\\Fonts\\DarN_Dundalk_28.fnt.fnt')

Also the "!" in the following may but shouldn't be a problem:

Quote

EditINI('Oblivion.ini', 'Fonts', 'SFontFile_1', 'Data\\Fonts\\DarN_!Sketchy_Times_36.fnt')

The Fonts section may require hard brace as well (check @Alt, @Utumno):

Quote

EditINI('Oblivion.ini', '[Fonts]', 'SFontFile_1', 'Data\\Fonts\\DarN_!Sketchy_Times_36.fnt')

...

Best to code in the Notes:

Quote

   SelectSubPackage '001 stats_config'
    ;;;Note: Not compatible with the Mod "oxp"

Requires more ifs but at least makes it on par with the omod. Can help there too. :)

Link to comment
Share on other sites

Thanks for going over it with another set of eyes.

I'm fairly certain my issue is with my Oblivion.ini and not with the installer since all of the INI Edits I'm using are now separate files that are known to be good from @alt3rn1ty's previous work with the WB guide.  I used BethINI to fix something that Oblivion Reloaded nuked, so that could be the root cause. I'll know more when I can sit down with it.

Link to comment
Share on other sites

Hi guys. Great work here, thank you very much! This is a bit off-topic, so feel free to disregard if you want.
 

Spoiler

 

I was wondering if this is going to be just for DarkUI'd Darn, or will there be a 'normal' DarNified UI version as well?

Imstearn, any luck on getting better fonts into this? My poor old eyes have a tough time with the DarNified fonts.

Beermotor, you mentioned BethIni. I've looked at it but was leery to try it. Do you like it and think it's worth giving a try? I'm going to try loading up OR 6.3 soon, and although I back up all my various ini's, this could save some time.

Also, since I'm off-topic anyway, do you prefer to be addressed as Mertz or Beermotor? (By the way, I'm assuming that's a reference to Fred Mertz from I Love Lucy? Love that show! :D )

Thanks again to you both for your work!! :)

 

 

Link to comment
Share on other sites

@alt3rn1ty: Wrye has not dealt with the possible mod incompatibilities dealt with in the Omod. A (completed) wizard may handle them better.

@RavenMind: Yep, On return to Oblivion, gonna see if I can import a modified version of the Skyrim Futura font into DJ Cobb's Jquery for a more definitive and shapely outcome. :)

Link to comment
Share on other sites

On 11/8/2017 at 6:46 PM, Beermotor said:

Thanks for going over it with another set of eyes.

I'm fairly certain my issue is with my Oblivion.ini and not with the installer since all of the INI Edits I'm using are now separate files that are known to be good from @alt3rn1ty's previous work with the WB guide.  I used BethINI to fix something that Oblivion Reloaded nuked, so that could be the root cause. I'll know more when I can sit down with it.

I figured out my problem with the fonts so I'm testing some new stuff. What happened was Wrinkly's weather patch added an .INI file that was defaulting in the editor. I literally overlooked it for days. :facepalm:

On 11/8/2017 at 7:31 PM, RavenMind said:

Hi guys. Great work here, thank you very much! This is a bit off-topic, so feel free to disregard if you want.
 

  Hide contents

 

I was wondering if this is going to be just for DarkUI'd Darn, or will there be a 'normal' DarNified UI version as well?

Imstearn, any luck on getting better fonts into this? My poor old eyes have a tough time with the DarNified fonts.

Beermotor, you mentioned BethIni. I've looked at it but was leery to try it. Do you like it and think it's worth giving a try? I'm going to try loading up OR 6.3 soon, and although I back up all my various ini's, this could save some time.

Also, since I'm off-topic anyway, do you prefer to be addressed as Mertz or Beermotor? (By the way, I'm assuming that's a reference to Fred Mertz from I Love Lucy? Love that show! :D )

Thanks again to you both for your work!! :)

 

 

 @RavenMind :  The answer to the first couple is Yes and it is a good utility. It doesn't do anything without backing things up first which is good.

I guess I'll go by Beermotor now since everybody knows me by that moniker. Mertz was just a name I made up for the Nexus back in 2006 or 2007 when I created my account, but yeah it is from I Love Lucy. Bill Frawley was actually an accomplished song and dance man. If you ever get a chance, look up "Bill Frawley Sings the Old Ones".  Sadly it isn't a Lovecraft reference.     ...or is it?

 

On 11/9/2017 at 5:43 AM, alt3rn1ty said:

@RavenMind Normal Darnified UI has already been done by Wrye in 2009 https://www.nexusmods.com/oblivion/mods/22170/?

Be sure to read "Package.txt" in the zip

Yes that's actually the version that I've used for years with Oblivion.  I never had much luck with the dark version because I always though it was messy and buggy.

Which brings me back to the clean up we're doing now.  Since my issue was self-inflicted, we'll have a  new build shortly as soon as I tinker with it a bit.

 

 

Link to comment
Share on other sites

Update: I've got the wizard fixed. Now I'm reinstalling Photoshop CC 2018 to do some image fix-ups after which it'll be ready. :)

Update2:  Due to my experiments Oblivion wouldn't load, so I had to reinstall the entire game and reinstall everything.  Not an issue thanks to Bash, however once I reinstalled the DarkUI mod I started getting crashes again.  So I have zero idea why this is happening but I'm going to copy each file manually out of the DarkUI'ed DarNified UI manual install mod to make sure everything is intact.

Update 3: Ok I've checked everything and everything is straight.  I can't even get to the opening menu but that may be my machine.

Here's a copy of the mod, packaged with the new wizard and all of the files, confirmed manually. Maybe someone can see something I'm missing.

Link to comment
Share on other sites

Looks fantastic!

"KCAS-AF Menus","Choose this if you have Kobu's Character Advancement System, AF leveling mod or Realistic Leveling installed. These mods use a different set of menus for the stats and level up menus.\n\nKCAS: http://www.tesnexus.com/downloads/file.php?id=1888\nAF Level Mod: http://www.tesnexus.com/downloads/file.php?id=3244\nRealistic Leveling: http://www.tesnexus.com/downloads/file.php?id=13879","Images\\ui\\dui_install1bg.jpg",\

The "Images" at the end is "Wizard Images"

Same for the following:

"No Quest Added popup","This gets rid of the Quest Added dialog alltogether. Your quest log still updates normally.\n\nAdded by request in 1.2.6, original mod & idea by andro: http://www.tesnexus.com/downloads/file.php?id=3394","Images\\ui\\dui_install1bg.jpg"

Are the ini tweaks working for the selections?

Does it continue to crash after uninstalling?

Guessing the ini tweaks will have to be reverted as well- or are they done automatically?

Link to comment
Share on other sites

1 hour ago, lmstearn said:

Looks fantastic!


"KCAS-AF Menus","Choose this if you have Kobu's Character Advancement System, AF leveling mod or Realistic Leveling installed. These mods use a different set of menus for the stats and level up menus.\n\nKCAS: http://www.tesnexus.com/downloads/file.php?id=1888\nAF Level Mod: http://www.tesnexus.com/downloads/file.php?id=3244\nRealistic Leveling: http://www.tesnexus.com/downloads/file.php?id=13879","Images\\ui\\dui_install1bg.jpg",\

The "Images" at the end is "Wizard Images"

Same for the following:


"No Quest Added popup","This gets rid of the Quest Added dialog alltogether. Your quest log still updates normally.\n\nAdded by request in 1.2.6, original mod & idea by andro: http://www.tesnexus.com/downloads/file.php?id=3394","Images\\ui\\dui_install1bg.jpg"

 

Thanks for finding that. I need a 4k Monitor. ;)

1 hour ago, lmstearn said:

Are the ini tweaks working for the selections?

Yes, I went with the Kingthings_exeter font once and then the Roosevelt font later, and both INI tweaks were installed as expected.

 

1 hour ago, lmstearn said:

Does it continue to crash after uninstalling?

No it stopped crashing when I uninstalled and went back to the regular DarNified UI.   There has to be something amiss in this mod and I'm too ignorant of proper Oblivion UI modding to recognize it.  If someone more knowledgeable could look at it that would be super-helpful.

1 hour ago, lmstearn said:

Guessing the ini tweaks will have to be reverted as well- or are they done automatically?

If I recall correctly I had to delete them after uninstalling the mod, but that could have been a remnant from a previous attempt.   Right now I see the "Colored Maps" INI edit was left behind so I'm inclined to believe they are not removed however.

 

EDIT: Here's an updated version of the mod with the image paths fixed, and this time I used "Pack to Archive" instead of "Package for Release" in case some needed files were unknowingly skipped.

Link to comment
Share on other sites

On 11/13/2017 at 4:09 AM, Beermotor said:

Thanks for finding that. I need a 4k Monitor. ;)

Yes, I went with the Kingthings_exeter font once and then the Roosevelt font later, and both INI tweaks were installed as expected.

 

No it stopped crashing when I uninstalled and went back to the regular DarNified UI.   There has to be something amiss in this mod and I'm too ignorant of proper Oblivion UI modding to recognize it.  If someone more knowledgeable could look at it that would be super-helpful.

If I recall correctly I had to delete them after uninstalling the mod, but that could have been a remnant from a previous attempt.   Right now I see the "Colored Maps" INI edit was left behind so I'm inclined to believe they are not removed however.

 

EDIT: Here's an updated version of the mod with the image paths fixed, and this time I used "Pack to Archive" instead of "Package for Release" in case some needed files were unknowingly skipped.

Thanks, added more conditions to the installer as anything with ";;;; note" still in the wizard there has to be coded in. Will fix the rest later. Run a diff with the following inclusions. Do you have Oblivion XP installed? That would explain a lot.

Edit2: Done!

wizard.7z

 

Link to comment
Share on other sites

@lmstearn Thank you sir. This is fine work.  I have not used Oblivion XP in a long time so I didn't know about that incompatibility. I'm glad you added detection to the wizard.

Bash threw a minor error on start-up due to some unicode gripe, so the only change I made was to rename the variables a bit. I'm not entirely sure why it made a difference but the unicode bugcheck went away.  I guess the wizard parser didn't like the hyphen in one of the names. 

I've added this new wizard to the BAIN and uploaded it to my Google Drive

I still can't get my Oblivion to run with it installed, and I have no idea why. :(

Given my limited time and knowledge of Oblivion UI stuff, I should probably move on to the HGEC body wizard.

Link to comment
Share on other sites

We're almost there. Just a tweak here or there is all maybe. Here's hoping it's just a font that isn't right in the ini.

Edit: Will want to update links first.

The custom font One selections include the tweaks for font Two font three etc

Quote

SFontFile_1=Data\Fonts\DarN_!Sketchy_Times_36.fnt
SFontFile_2=Data\Fonts\DarN_Kingthings_Petrock_14.fnt
SFontFile_3=Data\Fonts\DarN_Kingthings_Petrock_16.fnt
SFontFile_4=Data\Fonts\DarN_Oblivion_28.fnt
SFontFile_5=Data\Fonts\Handwritten.fnt

The selection of large/normal has to be changed similarly:

Quote

SFontFile_1=Data\Fonts\Kingthings_Regular.fnt
SFontFile_2=Data\Fonts\DarN_Kingthings_Petrock_14.fnt
SFontFile_3=Data\Fonts\DarN_Kingthings_Petrock_16.fnt
SFontFile_4=Data\Fonts\DarN_Oblivion_28.fnt
SFontFile_5=Data\Fonts\Handwritten.fnt

Will try this on the Oblivion machine at some stage and use the following OMOD as reference. 

Spoiler


//    Install script for DarNified UI 1.3.2
//    © Copyright 2007 - 2008, DarN.

using OblivionModManager.Scripting;
using System;
using System.IO;
using System.Xml;
using System.Drawing;
using System.Windows.Forms;

class Script : IScript
{
    public static IScriptFunctions sf;

    //     --------------------- Start Install Config Section ------------------------------
    //
    //    These are the settings used to select the defaults in the lists.
    //    Setting these properly will enable you to pre-select what you want,
    //    and simply press "Ok" when the page comes up.
    //
    //    You'll find a detailed walkthrough here: http://darnified.net/forums/index.php?topic=14.0
    //    Look for the section called "Automating the omod install".
    //
    //    These lists are zero based, which means in a list of 6 items,
    //    nr. 1 = 0, and nr. 6 = 5.

    int defFonts        =    0;        // Default font size
    int defFont1        =     0;        // Default Font 1 selection

    // Select which menus/options to pre-select (true = selected, false = not selected)

    bool[] defMenus = {        false,    // Breathmeter
                            false,    // Info Menu
                            false,    // Subtitles
                            false,    // Inventory
                            false,    // Dialog Menu
                            false,    // Magic Menu
                            false,    // Map Menu
                            false,    // Spell Purchase Menu
                            false,    // Container Menu
                            false,    // Repair Menu
                            false,    // Alchemy Menu
                            false,    // Persuasion Menu
                            false,    // Lockpick Menu
                            false,    // Recharge Menu
                            false,    // Training Menu
                            false,    // Spellmaking Menu
                            false,    // Enchantment Menu
                            false,    // System Menus
                            false,    // Quest Added Menu
                            false,    // Barter Pack
                            false,    // SleepWait Menu
                            false,    // LevelUp Menu
                            false,    // Chargen Pack
                            false,    // TextEdit Menu
                            false,    // Sigilstone Menu
                            false,    // Skill Perk Menu
                            false,    // Enchantment Setting Menu
                            false,    // Message Menu
                            false};    // Loading Menu

    bool[] defOptions = {    false,    // Custom Font 1
                            false,    // KCAS-AF Menus
                            false,    // Trollf Loading Screens
                            false,    // Classic Inventory
                            false,    // Documentation
                            false,    // Colored Local Map
                            false};    // No Quest Added popup

    // Other settings:

    string pn            =    "";        // Player name.
    bool showReminder    =    true;    // Show the confirmation reminder at the end of install?

    // Setting skipdetection to true will allow installation of compatability options regardless of the mods you have installed.

    bool skipdetection    =    false;

    // Setting unattended to true will install everything silently using the settings in
    // the config section. I recommend you set all values and go through each page to verify
    // that all selections are ok before you do this.

    bool unattended     =    false;

    // Example:
    //
    //    int defFonts        = 0;        (Normal)
    //    int defFont1        = 14;        (LaBrit_28)
    //    string pn            = "DarN";    (C'est moi :))
    //    bool showReminder    = false;    (We know to push 'yes' already...)
    //    bool skipdetection    = false;    (Filter out items I shouldn't be installing)
    //    bool unattended        = true;     (Silent install)
    //
    //    ------------------------ End Install Config Section -----------------------------

    bool updating = false, insstats = false, inslevelup = false, insinventory = false, insloading = false;
    string levelmode = "", installmode = "", duiVersion = "";

    string[] menuselections = new string[] {    "Breathmeter",
                                                "Info Menu",
                                                "Subtitles",
                                                "Inventory",
                                                "Dialog Menu",
                                                "Magic Menu",
                                                "Map Menu",
                                                "Spell Purchase Menu",
                                                "Container Menu",
                                                "Repair Menu",
                                                "Alchemy Menu",
                                                "Persuasion Menu",
                                                "Lockpick Menu",
                                                "Recharge Menu",
                                                "Training Menu",
                                                "Spellmaking Menu",
                                                "Enchantment Menu",
                                                "System Menus",
                                                "Quest Added Menu",
                                                "Barter Pack",
                                                "SleepWait Menu",
                                                "LevelUp Menu",
                                                "Chargen Pack",
                                                "TextEdit Menu",
                                                "Sigilstone Menu",
                                                "Skill Perk Menu",
                                                "Enchantment Setting Menu",
                                                "Message Menu",
                                                "Loading Menu"};

    string[] customoptions = new string[] {        "Custom Font 1",
                                                "KCAS-AF Menus",
                                                "Trollf Loading Screens",
                                                "Classic Inventory",
                                                "Documentation",
                                                "Colored Local Map",
                                                "No Quest Added popup"};

    string[] font1selections = new string[] {    "Default",
                                                "!Sketchy_Times_36",
                                                "Dundalk_28",
                                                "Endor_20",
                                                "FantaisieArtistique_28",
                                                "Immortal_28",
                                                "Kingthings_Exeter_28",
                                                "Knights_Quest_36",
                                                "Morris_Roman_28",
                                                "Ringbearer_22",
                                                "Roosevelt_28",
                                                "Walshes_36",
                                                "Yataghan_24",
                                                "Kingthings_Calligraphica_36",
                                                "LaBrit_28",
                                                "Gushing_Meadow_28"};


    string[] fonts = new string[] {             "Normal", "Large" };

    string[] initialdescs = new string[] {        "\n\n\n\nSelect the menus you wish to install in the list to the left.",
                                                "\n\n\n\nSelect the custom options you wish to install in the list to the left.",
                                                "\n\n\n\nSelect the font you want for font 1 in the list to the left.",
                                                "\n\n\n\nSelect the font size you wish to install in the list to the left."};

    // These arrays contain the esp/esm names for the mod detection function.
    // Edit these if there are omissions/errors, or just set skipdetection to true
    // to force the selections to be visible regardless.

    string[] trollf = {    "LoadingScreens.esp",
                        "LoadingScreens-OOO.esp",
                        "LoadingScreensSI.esp",
                        "LoadingScreensAddOn.esp"};

    string[] kcas = {    "RealisticLeveling.esp",
                        "Kobu's Character Advancement System.esp",
                        "AFLevelMod.esp"};

    string[] oxp = {    "Oblivion XP.esp"};
    
    string[] esps;
    
    string[] fontArr = { "Palatino Linotype", "Times New Roman", "Georgia" };


    Form spFrm, elFrm;
    ListBox lb;
    PictureBox pb, bgpb, epb, spb, apb;
    RichTextBox rtb;
    ToolStrip ts;
    Button bok, babort;
    Label versionLabel;
    Bitmap bm1, bm2, bm3, bm4, bm5, bm6, bm7, bm8;
    Page currentPage;

    enum Page { menus, options, font1select, fonts }


    void IScript.Execute(IScriptFunctions sf)
    {
        Script.sf = sf;

        Version requiredver = new Version(1, 1, 12, 0);

        if (sf.GetOBMMVersion() < requiredver) {
            MessageBox.Show("This mod must be installed with Oblivion Mod Manager version " + requiredver.ToString() + " or higher to prevent script errors.",
                            "Old OBMM version detected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            sf.FatalError();
            return;
        }
        sf.DontInstallAnyDataFiles();
        sf.DontInstallAnyPlugins();

        esps = sf.GetActiveEspNames();
        GetPlayerName();

        if (unattended) {
            SilentInstall();
            goto exitmsg;
        }
        CreateInitialDialog();

        switch (elFrm.ShowDialog()) {
            case DialogResult.OK:
                InstallEverything();
                CreateSelectPlentyDialog(Page.options);
                if (spFrm.ShowDialog() == DialogResult.Abort)
                    goto abort;
                break;
            case DialogResult.Retry:
                CreateSelectPlentyDialog(Page.menus);
                if (spFrm.ShowDialog() == DialogResult.Abort)
                    goto abort;
                break;
            default:                // Abort or Alt-F4
abort:            sf.FatalError();
                return;
        }

        // Final Message
exitmsg:    if (showReminder)
                MessageBox.Show("OBMM will now ask for confirmation as Oblivion.ini is modified to implement your choices.\nBe sure to click 'Yes' when asked. Hold down CTRL while pressing the button to choose yes/no to all.", "Modifying the ini", MessageBoxButtons.OK, MessageBoxIcon.Information);

    }//IScript.Execute


    // Initial form

    void CreateInitialDialog()
    {
        elFrm = sf.CreateCustomDialog();

        bgpb = new PictureBox();
        epb = new PictureBox();
        spb = new PictureBox();
        apb = new PictureBox();
        versionLabel = new Label();
        ((System.ComponentModel.ISupportInitialize)(bgpb)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(epb)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(spb)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(apb)).BeginInit();
        elFrm.SuspendLayout();
        //
        // bgpb
        //
        bgpb.Location = new Point(0, 0);
        bgpb.Name = "bgpb";
        bgpb.Size = new Size(370, 366);
        //
        // epb
        //
        epb.BackColor = Color.Transparent;
        epb.Location = new Point(50, 141);
        epb.Name = "epb";
        epb.Size = new Size(180, 30);
        epb.Click += new EventHandler(this.epb_Click);
        epb.MouseEnter += new EventHandler(this.epb_MouseEnter);
        epb.MouseLeave += new EventHandler(this.epb_MouseLeave);
        epb.Cursor = Cursors.Hand;
        //
        // spb
        //
        spb.BackColor = Color.Transparent;
        spb.Location = new Point(50, 177);
        spb.Name = "spb";
        spb.Size = new Size(180, 30);
        spb.Click += new EventHandler(this.spb_Click);
        spb.MouseEnter += new EventHandler(this.spb_MouseEnter);
        spb.MouseLeave += new EventHandler(this.spb_MouseLeave);
        spb.Cursor = Cursors.Hand;
        //
        // apb
        //
        apb.BackColor = Color.Transparent;
        apb.Location = new Point(50, 213);
        apb.Name = "apb";
        apb.Size = new Size(180, 30);
        apb.Click += new EventHandler(this.apb_Click);
        apb.MouseEnter += new EventHandler(this.apb_MouseEnter);
        apb.MouseLeave += new EventHandler(this.apb_MouseLeave);
        apb.Cursor = Cursors.Hand;
        //
        // versionLabel
        //
        versionLabel.AutoSize = true;
        versionLabel.BackColor = System.Drawing.Color.Transparent;
        versionLabel.Font = SetFont(8.25F, FontStyle.Bold);
        versionLabel.ForeColor = System.Drawing.Color.SaddleBrown;
        versionLabel.Location = new System.Drawing.Point(14, 336);
        versionLabel.Name = "versionLabel";
        versionLabel.TabIndex = 4;
        //
        // elForm
        //
        elFrm.AutoScaleDimensions = new SizeF(6F, 13F);
        elFrm.AutoScaleMode = AutoScaleMode.Font;
        elFrm.ClientSize = new Size(370, 366);
        elFrm.Controls.Add(versionLabel);
        elFrm.Controls.Add(apb);
        elFrm.Controls.Add(spb);
        elFrm.Controls.Add(epb);
        elFrm.Controls.Add(bgpb);
        elFrm.FormBorderStyle = FormBorderStyle.None;
        elFrm.Name = "elForm";
        elFrm.Text = "DarNified UI";
        elFrm.StartPosition = FormStartPosition.CenterScreen;
        elFrm.FormClosed += new FormClosedEventHandler(this.elFrm_FormClosed);
        ((System.ComponentModel.ISupportInitialize)(bgpb)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(epb)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(spb)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(apb)).EndInit();
        elFrm.ResumeLayout(false);
        elFrm.PerformLayout();

        bm1 = new Bitmap(new MemoryStream(sf.ReadDataFile("installfiles\\ui\\everything1.png")));
        bm2 = new Bitmap(new MemoryStream(sf.ReadDataFile("installfiles\\ui\\everything2.png")));
        bm3 = new Bitmap(new MemoryStream(sf.ReadDataFile("installfiles\\ui\\select1.png")));
        bm4 = new Bitmap(new MemoryStream(sf.ReadDataFile("installfiles\\ui\\select2.png")));
        bm5 = new Bitmap(new MemoryStream(sf.ReadDataFile("installfiles\\ui\\abort1.png")));
        bm6 = new Bitmap(new MemoryStream(sf.ReadDataFile("installfiles\\ui\\abort2.png")));
        bm7 = new Bitmap(new MemoryStream(sf.ReadDataFile("installfiles\\ui\\DUI_Install1bg.jpg")));

        epb.Parent = bgpb;
        spb.Parent = bgpb;
        apb.Parent = bgpb;
        versionLabel.Parent = bgpb;
        bgpb.Image = bm7;
        epb.Image = bm1;
        spb.Image = bm3;
        apb.Image = bm5;

        // Get version nr from xml
        byte[] ba = sf.ReadDataFile("menus\\options\\main_menu.xml");

        MemoryStream ms = new MemoryStream(ba);
        XmlTextReader xtr = new XmlTextReader(ms);

        xtr.MoveToContent();
        xtr.ReadToFollowing("_duiv");
        duiVersion = xtr.ReadString();
        xtr.Close();
        ms.Close();

        versionLabel.Text = duiVersion.Substring(14);
    }

    // Event handlers for initial form

    private void epb_MouseEnter(object sender, EventArgs e)
    {
        epb.Image = bm2;
    }

    private void epb_MouseLeave(object sender, EventArgs e)
    {
        epb.Image = bm1;
    }

    private void spb_MouseEnter(object sender, EventArgs e)
    {
        spb.Image = bm4;
    }

    private void spb_MouseLeave(object sender, EventArgs e)
    {
        spb.Image = bm3;
    }

    private void apb_MouseEnter(object sender, EventArgs e)
    {
        apb.Image = bm6;
    }

    private void apb_MouseLeave(object sender, EventArgs e)
    {
        apb.Image = bm5;
    }

    private void apb_Click(object sender, EventArgs e)
    {
        elFrm.Close();
    }

    private void epb_Click(object sender, EventArgs e)
    {
        elFrm.DialogResult = DialogResult.OK;
        elFrm.Close();
    }

    private void spb_Click(object sender, EventArgs e)
    {
        elFrm.DialogResult = DialogResult.Retry;
        elFrm.Close();
    }

    private void elFrm_FormClosed(object sender, FormClosedEventArgs e)
    {
        bm1.Dispose();
        bm2.Dispose();
        bm3.Dispose();
        bm4.Dispose();
        bm5.Dispose();
        bm6.Dispose();
        bm7.Dispose();
    }

    // Select form

    void CreateSelectPlentyDialog(Page mode)
    {
        spFrm = sf.CreateCustomDialog();

        bm8 = new Bitmap(new MemoryStream(sf.ReadDataFile("installfiles\\ui\\dui_logo.png")));

        lb = new ListBox();
        bok = new Button();
        babort = new Button();
        pb = new PictureBox();
        rtb = new RichTextBox();
        ts = new ToolStrip();
        ToolStripButton tsbSelectAll = new ToolStripButton();
        ToolStripButton tsbSelectNone = new ToolStripButton();
        ToolStripButton tsbInvert = new ToolStripButton();
        ((System.ComponentModel.ISupportInitialize)(pb)).BeginInit();
        ts.SuspendLayout();
        spFrm.SuspendLayout();
        //
        // lbComponents
        //
        lb.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left)));
        lb.Font = SetFont(8.25F, FontStyle.Bold);
        lb.ItemHeight = 16;
        lb.Location = new System.Drawing.Point(9, 9);
        lb.Margin = new Padding(0);
        lb.Name = "lb";
        lb.Size = new Size(272, 500);
        lb.TabIndex = 0;
        if (!unattended) {
            lb.SelectedIndexChanged += new EventHandler(this.lb_SelectedIndexChanged);
            lb.SizeChanged += new EventHandler(this.lb_SizeChanged);
        }
        //
        // btnOk
        //
        bok.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
        bok.Location = new Point(598, 522);
        bok.Margin = new Padding(3, 4, 3, 4);
        bok.Name = "bok";
        bok.Size = new Size(87, 30);
        bok.TabIndex = 1;
        bok.Text = "&Ok";
        bok.UseVisualStyleBackColor = true;
        bok.Click += new EventHandler(this.bok_Click);
        bok.Enabled = false;
        //
        // btnAbort
        //
        babort.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
        babort.DialogResult = DialogResult.Abort;
        babort.Location = new Point(691, 522);
        babort.Margin = new Padding(3, 4, 3, 4);
        babort.Name = "babort";
        babort.Size = new Size(87, 30);
        babort.TabIndex = 2;
        babort.Text = "&Abort";
        babort.UseVisualStyleBackColor = true;
        //
        // pb
        //
        pb.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
        pb.Location = new Point(284, 9);
        pb.Margin = new Padding(3, 4, 3, 4);
        pb.Name = "pb";
        pb.Size = new Size(496, 311);
        pb.SizeMode = PictureBoxSizeMode.Zoom;
        pb.Click += new EventHandler(this.pb_Click);
        pb.Cursor = Cursors.Hand;
        //
        // rtbDesription
        //
        rtb.Anchor = ((AnchorStyles)((((AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
        rtb.BackColor = SystemColors.Window;
        rtb.Cursor = Cursors.Default;
        rtb.Location = new Point(284, 323);
        rtb.Name = "rtb";
        rtb.ReadOnly = true;
        rtb.Size = new Size(496, 186);
        rtb.TabStop = false;
        rtb.SelectionAlignment = HorizontalAlignment.Center;
        rtb.WordWrap = true;
        //
        // ts
        //
        ts.LayoutStyle = ToolStripLayoutStyle.Flow;
        ts.Font = SetFont(8.25F, FontStyle.Regular);
        ts.Dock = DockStyle.None;
        ts.Items.AddRange(new ToolStripItem[] { tsbSelectAll, tsbSelectNone, tsbInvert });
        ts.Location = new Point(9, 509);
        ts.Name = "ts";
        ts.Size = new Size(211, 25);
        ts.Visible = true;
        //
        // tsbSelectAll
        //
        tsbSelectAll.Name = "tsbSelectAll";
        tsbSelectAll.Size = new Size(54, 22);
        tsbSelectAll.Text = "A&ll";
        tsbSelectAll.ToolTipText = "Select all entries";
        tsbSelectAll.Click += new EventHandler(this.tsbSelect_Click);
        //
        // tsbSelectNone
        //
        tsbSelectNone.Name = "tsbSelectNone";
        tsbSelectNone.Size = new Size(68, 22);
        tsbSelectNone.Text = "&None";
        tsbSelectNone.ToolTipText = "Deselect all entries";
        tsbSelectNone.Click += new EventHandler(this.tsbSelect_Click);
        //
        // tsbInvert
        //
        tsbInvert.Name = "tsbInvert";
        tsbInvert.Size = new Size(86, 22);
        tsbInvert.Text = "&Invert";
        tsbInvert.ToolTipText = "Select all unselected entries and deselect all selected ones";
        tsbInvert.Click += new EventHandler(this.tsbSelect_Click);
        //
        // SelectPlentyDialog
        //
        spFrm.AutoScaleDimensions = new SizeF(7F, 17F);
        spFrm.AutoScaleMode = AutoScaleMode.Font;
        spFrm.ClientSize = new Size(792, 566);
        spFrm.MinimumSize = new Size(800, 600);
        spFrm.Controls.Add(rtb);
        spFrm.Controls.Add(pb);
        spFrm.Controls.Add(babort);
        spFrm.Controls.Add(bok);
        spFrm.Controls.Add(lb);
        spFrm.Controls.Add(ts);
        spFrm.ControlBox = false;
        spFrm.Font = SetFont(9F, FontStyle.Regular);
        spFrm.Margin = new Padding(3, 4, 3, 4);
        spFrm.StartPosition = FormStartPosition.CenterScreen;
        spFrm.Name = "SelectPlentyDialog";
        spFrm.Text = duiVersion + " Install";
        spFrm.FormClosed += new FormClosedEventHandler(this.spFrm_FormClosed);

        InitPage(mode);
        ResetInfo();

        ((System.ComponentModel.ISupportInitialize)(pb)).EndInit();
        ts.BringToFront(); //helps flicker
        ts.ResumeLayout(false);
        ts.PerformLayout();
        spFrm.ResumeLayout(false);
        spFrm.PerformLayout();
    }

    // Event Handlers for Select form

    private void pb_Click(object sender, EventArgs e)
    {
        if (pb.Tag != "")
            sf.DisplayImage((string)pb.Tag, lb.Text);
    }

    private void bok_Click(object sender, EventArgs e)
    {
        switch (currentPage) {
            case Page.menus:
                InstallSelected(lb.SelectedItems);
                InitPage(Page.options);
            break;
            case Page.options:
                InstallCustomOptions(lb.SelectedItems);

                if (lb.SelectedItems.Contains("Custom Font 1"))
                    InitPage(Page.font1select);
                else InitPage(Page.fonts);
            break;
            case Page.font1select:
                InstallFont1(lb.Text);
                InitPage(Page.fonts);
            break;
            case Page.fonts:
                InstallFonts(lb.Text);
                spFrm.Close();
            break;
        }
        ResetInfo();
        ts.Visible = (lb.SelectionMode != SelectionMode.One);
    }

    private void lb_SelectedIndexChanged(object sender, EventArgs e)
    {
        if ((lb.SelectedItems.Count > 0) && !updating)
        {
            string[] descpath = { "" }, previewpath = { "" };

            switch (currentPage) {
                case Page.font1select:
                    previewpath[0] = "installfiles\\previews\\custom font 1.png";
                    descpath[0] = "installfiles\\descriptions\\custom font 1_2.rtf";
                break;
                default:
                    previewpath = sf.GetDataFiles("installfiles\\previews", lb.Text + ".*", false);
                    descpath = sf.GetDataFiles("installfiles\\descriptions", lb.Text + ".rtf", false);
                break;
            }
            if (descpath.Length > 0) {
                byte[] data = sf.ReadDataFile(descpath[0]);
                char[] str = new char[data.Length];

                for (int i = 0; i < data.Length; i++)
                    str = (char)data;

                StringWriter sw = new StringWriter();
                sw.Write(str);
                rtb.Rtf = sw.ToString();
                sw.Close();
                rtb.SelectionStart = 0;
                rtb.ScrollToCaret();
            }
            else {
                rtb.Text = "\n\n\n\nDescription not implemented";
            }
            if (previewpath.Length > 0) {
                MemoryStream ms = new MemoryStream(sf.ReadDataFile(previewpath[0]));
                pb.Image = Image.FromStream(ms);
                pb.Tag = previewpath[0];
                ms.Close();
            }
            else {
                pb.Image = bm8;
                pb.Tag = "";
            }
        }
        else if (lb.SelectedItems.Count == 0) {
            ResetInfo();
        }
        bok.Enabled = (lb.SelectedItems.Count > 0) || (currentPage == Page.options);
    }

    private void lb_SizeChanged(object sender, EventArgs e)
    {
        ts.Top = lb.Bottom;
    }

    private void tsbSelect_Click(object sender, EventArgs e)
    {
        updating = true;
        lb.BeginUpdate();
        int currind = lb.TopIndex;

        switch (((ToolStripButton)sender).Name) {
            case "tsbSelectAll":
                for (int i = 0; i < lb.Items.Count; i++)
                    lb.SetSelected(i, true);
                break;
            case "tsbSelectNone":
                lb.ClearSelected();
                break;
            case "tsbInvert":
                for (int i = 0; i < lb.Items.Count; i++)
                    lb.SetSelected(i, !lb.GetSelected(i));
                break;
        }
        lb.TopIndex = currind;
        lb.EndUpdate();
        updating = false;
    }

    private void spFrm_FormClosed(object sender, FormClosedEventArgs e)
    {
        bm8.Dispose();
    }

    // Install functions

    private void InstallEverything()
    {
        sf.InstallDataFolder("textures", true);
        sf.InstallDataFolder("menus", true);
        if (ModActive(oxp)) {
            sf.CancelDataFileCopy("menus\\main\\stats_menu.xml");
            sf.CancelDataFileCopy("menus\\prefabs\\darn\\stats_config.xml");
            sf.CancelDataFileCopy("menus\\levelup_menu.xml");
        }
        sf.InstallDataFolder("meshes", true);
        insstats = true;
        inslevelup = true;
        insinventory = true;
        insloading = true;
    }

    private void InstallSelected(ListBox.SelectedObjectCollection lbItems)
    {
        // shared components
        sf.InstallDataFolder("menus\\prefabs\\darn", true);
        if (ModActive(oxp))
            sf.CancelDataFileCopy("menus\\prefabs\\darn\\stats_config.xml");
        sf.InstallDataFolder("textures\\menus\\darn", true);
        sf.InstallDataFolder("meshes\\Menus\\darn", true);
        sf.InstallDataFile("menus\\main\\quickkeys_menu.xml");
        sf.InstallDataFile("menus\\options\\credits_menu.xml");
        sf.InstallDataFile("menus\\main\\hud_main_menu.xml");            // hud
        sf.InstallDataFile("menus\\main\\hud_reticle.xml");
        sf.InstallDataFile("menus\\book_menu.xml");

        if (!ModActive(oxp))
            sf.InstallDataFile("menus\\main\\stats_menu.xml");            // Oblivion XP Levelling

        insstats = true;

        foreach (Object opt in lbItems) {
            switch (opt.ToString()) {
                case "Breathmeter":
                    sf.InstallDataFile("menus\\breath_meter_menu.xml");
                    break;
                case "Info Menu":
                    sf.InstallDataFile("menus\\main\\hud_info_menu.xml");
                    break;
                case "Subtitles":
                    sf.InstallDataFile("menus\\main\\hud_subtitle_menu.xml");
                    break;
                case "Inventory":
                    sf.InstallDataFile("menus\\main\\inventory_menu.xml");
                    sf.InstallDataFile("menus\\main\\magic_popup_menu.xml");
                    insinventory = true;
                    break;
                case "Dialog Menu":
                    sf.InstallDataFile("menus\\dialog\\dialog_menu.xml");
                    break;
                case "Magic Menu":
                    sf.InstallDataFile("menus\\main\\magic_menu.xml");
                    break;
                case "Map Menu":
                    sf.InstallDataFile("menus\\main\\map_menu.xml");
                    break;
                case "Spell Purchase Menu":
                    sf.InstallDataFile("menus\\dialog\\spell_purchase.xml");
                    break;
                case "Container Menu":
                    sf.InstallDataFile("menus\\container_menu.xml");
                    break;
                case "Repair Menu":
                    sf.InstallDataFile("menus\\repair_menu.xml");
                    break;
                case "Alchemy Menu":
                    sf.InstallDataFile("menus\\dialog\\alchemy.xml");
                    break;
                case "Persuasion Menu":
                    sf.InstallDataFile("menus\\dialog\\persuasion_menu.xml");
                    break;
                case "Lockpick Menu":
                    sf.InstallDataFile("menus\\lockpick_menu.xml");
                    break;
                case "Recharge Menu":
                    sf.InstallDataFile("menus\\recharge_menu.xml");
                    break;
                case "Training Menu":
                    sf.InstallDataFile("menus\\training_menu.xml");
                    break;
                case "Spellmaking Menu":
                    sf.InstallDataFile("menus\\dialog\\spellmaking.xml");
                    break;
                case "Enchantment Menu":
                    sf.InstallDataFile("menus\\dialog\\enchantment.xml");
                    break;
                case "System Menus":
                    sf.InstallDataFolder("menus\\options", true);
                    break;
                case "Quest Added Menu":
                    sf.InstallDataFile("menus\\generic\\quest_added.xml");
                    break;
                case "Barter Pack":
                    sf.InstallDataFile("menus\\negotiate_menu.xml");
                    sf.InstallDataFile("menus\\quantity_menu.xml");
                    break;
                case "SleepWait Menu":
                    sf.InstallDataFile("menus\\sleep_wait_menu.xml");
                    break;
                case "LevelUp Menu":
                    sf.InstallDataFile("menus\\levelup_menu.xml");
                    inslevelup = true;
                    break;
                case "Chargen Pack":
                    sf.InstallDataFolder("menus\\chargen", true);
                    break;
                case "TextEdit Menu":
                    sf.InstallDataFile("menus\\dialog\\texteditmenu.xml");
                    break;
                case "Sigilstone Menu":
                    sf.InstallDataFile("menus\\dialog\\sigilstone.xml");
                    break;
                case "Skill Perk Menu":
                    sf.InstallDataFile("menus\\generic\\skill_perk.xml");
                    break;
                case "Enchantment Setting Menu":
                    sf.InstallDataFile("menus\\dialog\\enchantmentsetting_menu.xml");
                    break;
                case "Message Menu":
                    sf.InstallDataFile("menus\\message_menu.xml");
                    break;
                case "Loading Menu":
                    sf.InstallDataFile("menus\\loading_menu.xml");
                    insloading = true;
                    break;
            }//switch
        }//foreach
    }

    private void InstallCustomOptions(ListBox.SelectedObjectCollection lbOptions)
    {
        foreach (Object opt in lbOptions) {
            switch (opt.ToString()) {
                case "Custom Font 1":
                    // handled elsewhere
                    break;
                case "KCAS-AF Menus":
                    if (insstats && !ModActive(oxp))
                        sf.EditXMLReplace("menus\\prefabs\\darn\\stats_config.xml", "<_KCAS> &false; </_KCAS>", "<_KCAS> &true; </_KCAS>");
                    if (inslevelup && !ModActive(oxp))
                        sf.CopyDataFile("custom_files\\KCAS_levelup_menu.xml", "menus\\levelup_menu.xml");
                    break;
                case "Trollf Loading Screens":
                    sf.CopyDataFile("custom_files\\trollf_loading_menu.xml", "menus\\loading_menu.xml");
                    break;
                case "Classic Inventory":
                    sf.CopyDataFolder("custom_files\\classic_inventory\\", "", true);
                    break;
                case "Colored Local Map":
                    sf.EditINI("[Display]", "bLocalMapShader", "0");
                    break;
                case "Documentation":
                    sf.InstallDataFolder("Docs", true);
                    break;
                case "No Quest Added popup":
                    sf.CopyDataFile("custom_files\\empty.xml", "menus\\generic\\quest_added.xml");
                    break;
            }
        }
    }

    private void InstallFonts(string font)
    {
        sf.InstallDataFolder("fonts", true);
        sf.EditINI("[Fonts]", "SFontFile_4", "Data\\Fonts\\DarN_Oblivion_28.fnt");

        if (font == "Large") {
            sf.EditINI("[Fonts]", "SFontFile_2", "Data\\Fonts\\DarN_LG_Kingthings_Petrock_14.fnt");
            sf.EditINI("[Fonts]", "SFontFile_3", "Data\\Fonts\\DarN_LG_Kingthings_Petrock_18.fnt");
        }
        else {
            sf.EditINI("[Fonts]", "SFontFile_2", "Data\\Fonts\\DarN_Kingthings_Petrock_14.fnt");
            sf.EditINI("[Fonts]", "SFontFile_3", "Data\\Fonts\\DarN_Kingthings_Petrock_16.fnt");
        }
        // Old DarNified/Phinix cleanup
        string def_font5 = "Data\\Fonts\\Handwritten.fnt";
        string ini_font5 = sf.ReadINI("[Fonts]", "SFontFile_5");

        if (def_font5 != ini_font5)
            sf.EditINI("[Fonts]", "SFontFile_5", def_font5);
    }

    private void InstallFont1(string choice)
    {
        if (choice != "Default") {
            sf.CopyDataFile("custom_files\\fonts\\DarN_" + choice + ".fnt", "Fonts\\DarN_" + choice + ".fnt");
            sf.CopyDataFile("custom_files\\fonts\\DarN_" + choice + ".tex", "Fonts\\DarN_" + choice + ".tex");
            sf.EditINI("[Fonts]", "SFontFile_1", "Data\\Fonts\\DarN_" + choice + ".fnt");
        }
    }

    private void SilentInstall()
    {
        CreateSelectPlentyDialog(Page.menus); // Init menus called here
        InstallSelected(lb.SelectedItems);

        InitPage(Page.options);

        if (lb.SelectedItems.Count > 0) {
            InstallCustomOptions(lb.SelectedItems);

            if (lb.SelectedItems.Contains("Custom Font 1")) {
                InitPage(Page.font1select);
                InstallFont1(lb.Text);
            }
            InitPage(Page.fonts);
            InstallFonts(lb.Text);
        }
    }

    private void ResetInfo()
    {
        if (!unattended) {
            pb.Image = bm8;
            pb.Tag = "";

            rtb.ResetFont();
            rtb.Text = initialdescs[(int)currentPage];
        }
    }

    private void InitPage(Page page)
    {
        try {
                currentPage = page;
                updating = true;

                lb.Items.Clear();

                switch (page) {
                    case Page.menus:
                        lb.Items.AddRange(menuselections);
                        lb.SelectionMode = SelectionMode.MultiExtended;

                        for (int i = 0; i < defMenus.Length; i++)
                            lb.SetSelected(i, defMenus);

                        // Filter out redundant items
                        if (ModActive(oxp))
                            lb.Items.RemoveAt(lb.FindStringExact("LevelUp Menu"));
                    break;
                    case Page.options:
                        lb.Items.AddRange(customoptions);
                        lb.SelectionMode = SelectionMode.MultiExtended;
                        bok.Enabled = true;

                        for (int i = 0; i < defOptions.Length; i++)
                            lb.SetSelected(i, defOptions);

                        // Filter out redundant items
                        if (!ModInstalled(trollf) || !insloading) {
                            lb.Items.RemoveAt(lb.FindStringExact("Trollf Loading Screens"));
                        }
                        if (!ModActive(kcas) || ModActive(oxp)) {
                            lb.Items.RemoveAt(lb.FindStringExact("KCAS-AF Menus"));
                        }
                        if (!insinventory) {
                            lb.Items.RemoveAt(lb.FindStringExact("Classic Inventory"));
                        }
                    break;
                    case Page.font1select:
                        lb.Items.AddRange(font1selections);
                        lb.SelectionMode = SelectionMode.One;
                        lb.SetSelected(defFont1, true);
                    break;
                    case Page.fonts:
                        lb.Items.AddRange(fonts);
                        lb.SelectionMode = SelectionMode.One;
                        lb.SetSelected(defFonts, true);
                    break;
                }
                updating = false;
            }
        catch (Exception e)
        {
            MessageBox.Show("Exception: " + e.Message, "DUI Install - Error in InitPage()", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }
    }

    private bool ModInstalled(string[] modnameArr) // for Bashed mods (trollf)
    {
        for (int i = 0; i < modnameArr.Length; i++) {
            if (sf.DataFileExists(modnameArr))
                return true;
        }
        return skipdetection;
    }

    private bool ModActive(string[] modnameArr)
    {
        for (int i = 0; i < modnameArr.Length; i++) {
            for (int x = 0; x < esps.Length; x++) {
                if (esps[x] == modnameArr)
                    return true;
            }
        }
        return skipdetection;
    }

    private Font SetFont(float fontSize, FontStyle style)
    {
        for (int i = 0; i < fontArr.Length; i++) {
            foreach (FontFamily font in FontFamily.Families) {
                if (font.Name == fontArr && font.IsStyleAvailable(style)) {
                    return new Font(font.Name, fontSize, style, GraphicsUnit.Point);
                }
            }
        }
        return new Font("Arial", fontSize, FontStyle.Regular, GraphicsUnit.Point);
    }

    private void GetPlayerName()
    {
        // Get players name in the credits
        //pn = sf.InputString("What's your name?"); //needs bugfix
        if (pn == "")
            pn = ShowInputDialog();

        if (pn != "")
            sf.EditXMLReplace("menus\\options\\credits_menu.xml", "<string>You</string>", "<string>" + pn + "</string>");
    }

    // Stop gap input dialog...
    Button btnOk;
    TextBox textBox1;
    Form ipFrm;

    private string ShowInputDialog()
    {
        ipFrm = sf.CreateCustomDialog();

        btnOk = new Button();
        textBox1 = new TextBox();
        ipFrm.SuspendLayout();
        //
        // btnOk
        //
        btnOk.DialogResult = DialogResult.OK;
        btnOk.Location = new Point(86, 49);
        btnOk.Name = "btnOk";
        btnOk.Size = new Size(75, 23);
        btnOk.TabIndex = 1;
        btnOk.Text = "&Ok";
        btnOk.UseVisualStyleBackColor = true;
        btnOk.Click += new EventHandler(btnOk_Click);
        //
        // textBox1
        //
        textBox1.Location = new Point(12, 12);
        textBox1.MaxLength = 50;
        textBox1.Name = "textBox1";
        textBox1.Size = new Size(236, 20);
        textBox1.TabIndex = 0;
        //
        // InputDialog
        //
        ipFrm.AutoScaleDimensions = new SizeF(6F, 13F);
        ipFrm.AutoScaleMode = AutoScaleMode.Font;
        ipFrm.ClientSize = new Size(259, 89);
        ipFrm.Controls.Add(textBox1);
        ipFrm.Controls.Add(btnOk);
        ipFrm.AcceptButton = btnOk;
        ipFrm.FormBorderStyle = FormBorderStyle.FixedToolWindow;
        ipFrm.Name = "InputDialog";
        ipFrm.StartPosition = FormStartPosition.CenterParent;
        ipFrm.Text = "What\'s your name?";
        ipFrm.ResumeLayout(false);
        ipFrm.PerformLayout();

        if (ipFrm.ShowDialog() == DialogResult.OK) {
            if (ipFrm.Tag != "")
                return (string)ipFrm.Tag;
            else
                return "";
        }
        else return "";
    }

    private void btnOk_Click(object sender, EventArgs e)
    {
        ipFrm.Tag = textBox1.Text;
    }
}//script
 

The HGEC sounds good. :)

  • Like 2
Link to comment
Share on other sites

The HGEC BBB Body BCF + Wizard is done.   @Sladen2019

I like the way this one turned out and it actually works well. :)

HGEC_Body_with_BBB_BAIN-34442-1-12-BCF.7z

This BCF is for the .7z version of the mod.

BCF info:

Spoiler

== Overview

. Name: HGEC_Body_with_BBB_BAIN-34442-1-12-BCF.7z
. Size: 9 KB
. Remapped: 304files

. Requires: 1file
  * (9D8C18BC) - HGEC_Body_with_BBB_v1dot12 7z-34442-1-12.7z

. Options:
  * Skip Voices   = False
  * Solid Archive = True
    *  Solid Block Size = 7z default
  *  Has Comments  = False
  *  Has Extra Directories = False
  *  Has Esps Unselected   = False
  *  Has Packages Selected = True

. Contains: 1file
  * Wizard.txt

 

Give it a whirl boys (and girls) and let me know what you think. :)

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Hi. I just tested out the HGEC BCF. During conversion, it halts at the compression stage & throws the error in the screenshot below. I'm wondering if I'm doing something wrong, as this is the first time I've tried applying a BCF.  I attached my BashBugDump.log. It looks to me like it's probably nothing to do with your BCF, rather a problem with the way it's writing or reading the name of the temp file created prior to compression. The second traceback is from when I try to "Pack to Archive". Same final error. Tried also "Package for Release" and tried both solid & non-solid compression on both. Do you think this is something I should kick over to Utumno?

Screens:

Spoiler

Conversion-Apply.png.9550d2acc664b40680ba456b62276459.png

 

FileName.png.e36fda6aba3f38cd1447020d54a32fa9.png

 

Error.png.f04daa39097091b09c9224fb2d57cb8f.png

BugDump:

Spoiler

Wrye Bash starting
Using Wrye Bash Version 307.201711041935
OS info: Windows-8-6.2.9200
Python version: 2.7.10
wxPython version: 2.8.12.1 (msw-unicode)
input encoding: UTF8; output encoding: None; locale: ('en_US', 'cp1252')
filesystem encoding: mbcs
Using scandir 1.6
bash.py  316 _main: Searching for game to manage:
bush.py   76 _supportedGames: Detected the following supported games via Windows Registry:
bush.py   78 _supportedGames:  Oblivion: c:\users\chuck\games\oblivion
bush.py   78 _supportedGames:  Skyrim Special Edition: D:\Games - D\Steam - D\steamapps\common\Skyrim Special Edition
bush.py   78 _supportedGames:  Fallout4: D:\Games - D\Steam - D\steamapps\common\Fallout 4
bush.py  136 _detectGames: Detecting games via the -o argument, bash.ini and relative path:
bush.py  142 _detectGames: Set game mode to Oblivion found in parent directory of Mopy:  C:\Users\Chuck\Games\Oblivion
bush.py  156 __setGame:  Using Oblivion game: C:\Users\Chuck\Games\Oblivion
testing UAC
mods_metadata.py  227 __init__: Using LOOT API version: 0.10.1
bain.py 1780 apply_converter: HGEC_Body_with_BBB_BAIN-34442-1-12.7z: An error occurred while applying an Auto-BCF.Maybe the BCF was packed for another installer ?
Traceback (most recent call last):
  File "bash\bosh\bain.py", line 1761, in apply_converter
    embedded=installer.crc if installer else 0L)
  File "bash\bosh\converters.py", line 368, in apply
    SubProgress(progress, 0.7, 1.0))
  File "bash\bosh\converters.py", line 552, in pack
    archives.compress7z(command, outDir, destArchive, srcFolder, progress)
  File "bash\archives.py", line 75, in compress7z
    u'7z.exe return value: ' + str(returncode) + u'\n' + errorLine)
StateError: HGEC_Body_with_BBB_BAIN-34442-1-12.7z: Compression failed:
7z.exe return value: 2


Traceback (most recent call last):
  File "bash\balt.py", line 2495, in __Execute
    self.Execute()
  File "bash\balt.py", line 1605, in _conversation_wrapper
    return func(*args, **kwargs)
  File "bash\basher\installer_links.py", line 1009, in Execute
    release=self.__class__.release)
  File "bash\basher\installer_links.py", line 106, in _pack
    release=release)
  File "bash\bosh\bain.py", line 1437, in packToArchive
    compress7z(command, outDir, outFile.tail, projectDir, progress)
  File "bash\archives.py", line 75, in compress7z
    u'7z.exe return value: ' + str(returncode) + u'\n' + errorLine)
bash.exception.StateError: bash_temp_nonunicode_name.tmp: Compression failed:
7z.exe return value: 2

 

Link to comment
Share on other sites

14 hours ago, RavenMind said:

Hi. I just tested out the HGEC BCF. During conversion, it halts at the compression stage & throws the error in the screenshot below. I'm wondering if I'm doing something wrong, as this is the first time I've tried applying a BCF.  I attached my BashBugDump.log. It looks to me like it's probably nothing to do with your BCF, rather a problem with the way it's writing or reading the name of the temp file created prior to compression. The second traceback is from when I try to "Pack to Archive". Same final error. Tried also "Package for Release" and tried both solid & non-solid compression on both. Do you think this is something I should kick over to Utumno?

Screens:

  Hide contents

Conversion-Apply.png.9550d2acc664b40680ba456b62276459.png

 

FileName.png.e36fda6aba3f38cd1447020d54a32fa9.png

 

Error.png.f04daa39097091b09c9224fb2d57cb8f.png

BugDump:

  Hide contents

Wrye Bash starting
Using Wrye Bash Version 307.201711041935
OS info: Windows-8-6.2.9200
Python version: 2.7.10
wxPython version: 2.8.12.1 (msw-unicode)
input encoding: UTF8; output encoding: None; locale: ('en_US', 'cp1252')
filesystem encoding: mbcs
Using scandir 1.6
bash.py  316 _main: Searching for game to manage:
bush.py   76 _supportedGames: Detected the following supported games via Windows Registry:
bush.py   78 _supportedGames:  Oblivion: c:\users\chuck\games\oblivion
bush.py   78 _supportedGames:  Skyrim Special Edition: D:\Games - D\Steam - D\steamapps\common\Skyrim Special Edition
bush.py   78 _supportedGames:  Fallout4: D:\Games - D\Steam - D\steamapps\common\Fallout 4
bush.py  136 _detectGames: Detecting games via the -o argument, bash.ini and relative path:
bush.py  142 _detectGames: Set game mode to Oblivion found in parent directory of Mopy:  C:\Users\Chuck\Games\Oblivion
bush.py  156 __setGame:  Using Oblivion game: C:\Users\Chuck\Games\Oblivion
testing UAC
mods_metadata.py  227 __init__: Using LOOT API version: 0.10.1
bain.py 1780 apply_converter: HGEC_Body_with_BBB_BAIN-34442-1-12.7z: An error occurred while applying an Auto-BCF.Maybe the BCF was packed for another installer ?
Traceback (most recent call last):
  File "bash\bosh\bain.py", line 1761, in apply_converter
    embedded=installer.crc if installer else 0L)
  File "bash\bosh\converters.py", line 368, in apply
    SubProgress(progress, 0.7, 1.0))
  File "bash\bosh\converters.py", line 552, in pack
    archives.compress7z(command, outDir, destArchive, srcFolder, progress)
  File "bash\archives.py", line 75, in compress7z
    u'7z.exe return value: ' + str(returncode) + u'\n' + errorLine)
StateError: HGEC_Body_with_BBB_BAIN-34442-1-12.7z: Compression failed:
7z.exe return value: 2


Traceback (most recent call last):
  File "bash\balt.py", line 2495, in __Execute
    self.Execute()
  File "bash\balt.py", line 1605, in _conversation_wrapper
    return func(*args, **kwargs)
  File "bash\basher\installer_links.py", line 1009, in Execute
    release=self.__class__.release)
  File "bash\basher\installer_links.py", line 106, in _pack
    release=release)
  File "bash\bosh\bain.py", line 1437, in packToArchive
    compress7z(command, outDir, outFile.tail, projectDir, progress)
  File "bash\archives.py", line 75, in compress7z
    u'7z.exe return value: ' + str(returncode) + u'\n' + errorLine)
bash.exception.StateError: bash_temp_nonunicode_name.tmp: Compression failed:
7z.exe return value: 2

 

Maybe. I wonder if this is affecting anyone else.  @Sladen2019 have you tried it out yet?

If it is bombing for other people I'll try to re-create the BCF.  If after that it keeps bombing out then yes we may have a bug.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...