BIG change in directory handling:
- Unix users can "make install" and "make uninstall" (as root). - Installation creates shortcuts "grafx2" and "gfx2cfg" in /usr/local/bin - Installation puts data files (icon GIFs, gfx2.dat,..) and the actual binaries in /usr/local/share/grafx2 - At runtime, the programs search and create configuration files (gfx2.cfg and gfx2.ini) in ~/.grafx2 (But if there are some present in program's own directory, they override) - Uninstall removes programs and data, but leaves all users' configurations. Win32: User's config directory is %APPDATA%\GrafX2 Win98: %APPDATA% is not set by default, so the program falls back to executable's directory. Tested on Debian Linux Partially tested on Win XP (early version) Tested on Win98 git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@365 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
14
saveini.c
14
saveini.c
@@ -26,7 +26,7 @@
|
||||
#include "const.h"
|
||||
#include "global.h"
|
||||
#include "readini.h"
|
||||
#include "files.h"
|
||||
#include "io.h"
|
||||
#include "erreurs.h"
|
||||
#include "graph.h"
|
||||
|
||||
@@ -389,23 +389,23 @@ int Sauver_INI(struct S_Config * Conf)
|
||||
FILE * Nouveau_fichier;
|
||||
char * Buffer;
|
||||
int Valeurs[3];
|
||||
char Nom_du_fichier[256];
|
||||
char Nom_du_fichier_temporaire[256];
|
||||
char Nom_du_fichier[TAILLE_CHEMIN_FICHIER];
|
||||
char Nom_du_fichier_temporaire[TAILLE_CHEMIN_FICHIER];
|
||||
int Retour;
|
||||
char Nom_du_fichier_DAT[256];
|
||||
char Nom_du_fichier_DAT[TAILLE_CHEMIN_FICHIER];
|
||||
int Ini_existe;
|
||||
|
||||
// On alloue les zones de mémoire:
|
||||
Buffer=(char *)malloc(1024);
|
||||
|
||||
// On calcule les noms des fichiers qu'on manipule:
|
||||
strcpy(Nom_du_fichier,Repertoire_du_programme);
|
||||
strcpy(Nom_du_fichier,Repertoire_de_configuration);
|
||||
strcat(Nom_du_fichier,"gfx2.ini");
|
||||
|
||||
// On vérifie si le fichier INI existe
|
||||
if ((Ini_existe = Fichier_existe(Nom_du_fichier)))
|
||||
{
|
||||
strcpy(Nom_du_fichier_temporaire,Repertoire_du_programme);
|
||||
strcpy(Nom_du_fichier_temporaire,Repertoire_de_configuration);
|
||||
strcat(Nom_du_fichier_temporaire,"gfx2.$$$");
|
||||
|
||||
// On renome l'ancienne version du fichier INI vers un fichier temporaire:
|
||||
@@ -415,7 +415,7 @@ int Sauver_INI(struct S_Config * Conf)
|
||||
}
|
||||
}
|
||||
// On récupère un fichier INI "propre" dans GFX2.DAT
|
||||
strcpy(Nom_du_fichier_DAT,Repertoire_du_programme);
|
||||
strcpy(Nom_du_fichier_DAT,Repertoire_des_donnees);
|
||||
strcat(Nom_du_fichier_DAT,"gfx2.dat");
|
||||
Ancien_fichier=fopen(Nom_du_fichier_DAT,"rb");
|
||||
if (Ancien_fichier==0)
|
||||
|
||||
Reference in New Issue
Block a user