Jump to content


Photo

A couple of mod-packaging questions


  • Please log in to reply
14 replies to this topic

#1 Miss Sakaki

Miss Sakaki

    Modder

  • Modder
  • 505 posts

Posted 03 October 2007 - 07:52 AM

I have enough knowledge of NSIS scripting to create an archive using a tutorial, but that's about it, so I was wondering - how do you enable a mod to be installed when the tp2 is in the mod folder? And I want to include an auto-updating bat with the mod, which I have, but I don't know how to get it to run when the self-extracting archive is done extracting.

#2 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 03 October 2007 - 08:00 AM

But why not just use a zip or rar, so you there is no need for the hasle(sp?) of self-extracting archives?

Deactivated account. The user today is known as The Imp.


#3 berelinde

berelinde

    Troublemaker

  • Modder
  • 4916 posts

Posted 03 October 2007 - 08:22 AM

This Wiki article is intended to assist G3 modders in packaging their mods, however it should be viewable and usable by anyone.

Some users perfer the NSIS installer, others like an SFX installer. I prefer the latter, because I like the option of extracting the mod without necessarily installing it at that time. I do not want the NSIS installer to creatue a c:\program files\black isle\bg ii - soa directory on my work computer, which an NSIS installer will do if it doesn't find the game installed anywhere.

"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum


#4 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 03 October 2007 - 09:47 AM

I do not want the NSIS installer to creatue a c:\program files\black isle\bg ii - soa directory on my work computer, which an NSIS installer will do if it doesn't find the game installed anywhere.


NSIS installer doesn't create anything of the sort, unless you'd want it to. It asks you to choose the directory; by default it's your BG2 directory, but it may change.



I have enough knowledge of NSIS scripting to create an archive using a tutorial, but that's about it, so I was wondering - how do you enable a mod to be installed when the tp2 is in the mod folder?


It's done automatically. However, it's important not to move .tp2 - i.e. if v1 has .tp2 outside, outside it should stay(because users won't delete the old .tp2, and so on).

And I want to include an auto-updating bat with the mod, which I have, but I don't know how to get it to run when the self-extracting archive is done extracting.


Here's RE nsis file(colors blanked); you need "Exec" line:

Name "Romantic Encounters v2"
OutFile "RE_v2.exe"
Icon "C:\Games\BGII\G3.ico"
ShowInstDetails show
AutoCloseWindow true
BGGradient 000000 000000 000000
Section "default"
SetOutPath $INSTDIR
File "C:\Games\BGII\Setup-RE.exe"
File /r "C:\Games\BGII\RE"
Exec "$INSTDIR\RE\Audio\Setup-RE.bat"
SectionEnd
InstallDirRegKey HKLM \
"Software\Microsoft\Windows\CurrentVersion\App Paths\BG2Main.Exe" \
"Path"
DirText "Select your Baldur's Gate II directory."
Function .onInit
MessageBox MB_YESNO "This will install Romantic Encounters v2. Continue?" IDYES NoAbort
Abort
NoAbort:
FunctionEnd

#5 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 03 October 2007 - 10:44 AM

p1-p2.exe will launch the first it finds out of: p2.tp2 p1-p2.tp2 p2/p2.tp2 p1/p1-p2.tp2.
p1-p2-p3.exe will launch the first it finds out of: p2.tp2 p1-p2-p3.tp2 p2/p2.tp2 p1/p1-p2-p3.tp2.

if p1 is different than setup then autoupdate will not work.


Now you know :)

Edited by the bigg, 03 October 2007 - 10:46 AM.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#6 Miss Sakaki

Miss Sakaki

    Modder

  • Modder
  • 505 posts

Posted 03 October 2007 - 02:44 PM

But why not just use a zip or rar, so you there is no need for the hasle(sp?) of self-extracting archives?


Because an install screen is prettier, and you get colours, and stuff. Also, I can well remember the tentativeness with which I extracted my first mod (Solaufein, I think) and how worried I was that I was doing something wrong. Anything that helps people install mods as smoothly as possible is good in my book.

Thank you everyone for the advice and links! I shall get my teeth into it directly. Just this one thing...

It's done automatically.


When I have the exe in my BGII folder and the tp2 in the mod folder, it comes up with the "tp2 not found" message. Do you know what I might be doing wrong? I imagine I'm missing something simple.

#7 Caedwyr

Caedwyr

    Wraith Editor

  • Member
  • 962 posts

Posted 03 October 2007 - 02:53 PM

You are aware that SFX does the exact same thing, right? For example, the below is a screenshot I took immediately after double-clicking on the Kivan-v8.exe in the folder. Note that the file is on the E: drive, but the installer still points at the default BGII - SoA directory.

Posted Image
"Knowledge is Power. Power Corrupts. Study Hard. Be Evil." - Ferret

PnP Celestials
Geomantic Sorcerer Kit

#8 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 03 October 2007 - 10:20 PM

You are aware that SFX does the exact same thing, right?


No, it doesn't. NSIS automatically finds your BG2 path; with SFX archives, you have to search for it.

Also, when you click on SFX archive, this small window you posted tends to disappear/get buried over other windows, or, at least, this is the case with me.

In short, SFX may give modders who want to download and dissect your mod an easier time. But NSIS gives players an easier time.




When I have the exe in my BGII folder and the tp2 in the mod folder, it comes up with the "tp2 not found" message. Do you know what I might be doing wrong? I imagine I'm missing something simple.


Did you delete the old .tp2 and the old version of the mod? Are you sure your tp2 is in the packed mod folder(I'd advise to double-check, even if it sounds silly). Can it be a Weidu issue(try Weidu 199 from an older mod(any of my mods have it, for example) to compare)?

#9 Miss Sakaki

Miss Sakaki

    Modder

  • Modder
  • 505 posts

Posted 04 October 2007 - 02:27 AM

Did you delete the old .tp2 and the old version of the mod? Are you sure your tp2 is in the packed mod folder(I'd advise to double-check, even if it sounds silly). Can it be a Weidu issue(try Weidu 199 from an older mod(any of my mods have it, for example) to compare)?


Everything seems to be in order - the tp2's in the mod folder and the exe is where it should be, and the auto-update's working fine (thanks for the example script!), but it doesn't find the tp2. I tried renaming Xan's exe and using that, but it did the same thing.

#10 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 04 October 2007 - 03:12 AM

There should be one, tiny, really unremarkable small error somewhere. I mean, it worked for Nathaniel, right?

Okay, let me guess: open your .nsi file and check the directory you've written there. Then go to this directory, open it and check that .tp2 is inside. It could be that 'mod folder' and 'folder-which-is-actually-written-in-.nsi-file' are two different things.

#11 Miss Sakaki

Miss Sakaki

    Modder

  • Modder
  • 505 posts

Posted 04 October 2007 - 06:14 AM

Still not working, I'm afraid. With Nathaniel the tp2 is in the BGII folder with the exe - it was released a little while before putting the tp2 in the mod folder was common practice. I think I'm just going to stick with that for the moment - there doesn't seem much point spending a lot of effort on something I was going to implement purely for the sake of neatness. Thank you very much for the assistance, anyway - I appreciate it!

#12 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 04 October 2007 - 07:10 AM

Sure, not a problem. One question, though: what are the _exact_ names of your Setup-MyMod.exe, MyMod folder and your .tp2 file?

#13 Miss Sakaki

Miss Sakaki

    Modder

  • Modder
  • 505 posts

Posted 04 October 2007 - 07:55 AM

Setup-Luxley-SoA, Luxley-SoA and Setup-Luxley-SoA, respectively.

#14 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 04 October 2007 - 08:05 AM

What happens if you drop "-"? Setup-LuxleySoA.exe, LuxleySoA, Setup-LuxleySoA.tp2?

#15 Miss Sakaki

Miss Sakaki

    Modder

  • Modder
  • 505 posts

Posted 04 October 2007 - 08:44 AM

It worked! Awesome. Thank you very much, both for the help and being so patient. :cheers: