Aller au contenu

Photo

Auto Installer Help


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
seraphimsage

seraphimsage
  • Members
  • 104 messages
I've made a auto-installer for my Nihil Trilogy: Awakening module with C++, and I hope to use it in the next two parts of my trilogy. Its purpose is to install both the .mod and the .hak file to their corresponding module and hak folders. It works as expected but it's not as efficient as I would like. If one is experienced in this field, I would like your advice.

Right now it is compressed as a .rar and includes: the .exe file, directions, and a folder containing the .mod and the .hak.

My main goal is to make it all into one single .exe file so it doesn't have to be decompressed. If anyone knows how to do that I would appreciate your help?

//Here is the c++ code I used to construct it:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include
#include
using namespace std;

/*
////////////////////////////////////////////////////////////////////////////////////////////////////////////
*Nihil Awakening Auto Installer Program
*By Seraphimsage
*
*This program uses the dos command prompt and installs the:
*
*Nihil_Trilogy_Part_I_Awakening.mod to the C:/Username/%USERNAME/Documents/Neverwinter Night *2/modules folder
*
*nihilhaks.hak to the C:/Username/%USERNAME/Documents/Neverwinter Night 2/hak folder
*
*@Nihil_Awakening_Auto_Installer, @Files/Nihil_Trilogy_Part_I_Awakening.mod, *@Files/nihilhaks.hak
////////////////////////////////////////////////////////////////////////////////////////////////////////////
*/

int main()
{

cout <<"Nihil Trilogy Awakening Auto Install Program:\\n\\n";
cout <<"///////////////////////////////////////////////////////////////////\\n";

try
{
//Accesses the 'modules' folder and copies the Nihil_Trilogy_Part_I_Awakening.mod located in the 'File' folder into it.
cout << "\\nNihil_Trilogy_Part_I_Awakening.mod installed to 'modules' Folder\\n";
system("\\"copy Files\\\\Nihil_Trilogy_Part_I_Awakening.mod \\"c:\\\\Users\\\\%USERNAME%\\\\Documents\\\\Neverwinter Nights 2\\"\\\\modules");

//Accesses the 'hak' folder and copies the nihilhaks.hak located in the 'File' folder into it.
cout << "\\nnihilhaks.hak installed to 'hak' Folder \\n";
system("\\"copy Files\\\\nihilhaks.hak \\"c:\\\\Users\\\\%USERNAME%\\\\Documents\\\\Neverwinter Nights 2\\"\\\\hak");

//Ending message noting to press the 'Enter' key to exit.
cout <<"\\n///////////////////////////////////////////////////////////////////\\n";
cout << "\\nAll the Nihil Trilogy Awakening Files have been installed successfully.\\n\\nPlease press the 'Enter' key to exit!\\n";
}
catch (exception& e)
{
cout << "An error has occured which has prevented the installation of the Nihil Trilogy Awakening Module";
cout << "Exception details: " << e.what() << endl;
}

system("PAUSE");
}

Modifié par seraphimsage, 08 décembre 2010 - 11:45 .


#2
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
I have no programming advice to give on this. But as a Mac user I would suggest that a Windows-specific install process is going to prevent Mac users from being able to play your module unless you also provide alternative directions for them.

#3
seraphimsage

seraphimsage
  • Members
  • 104 messages
I can try an alternate version with java using Unix commands, so it can work with macs, but don't worry in any case I'll still include the separate files for a manual installation.