Re: Packing a C# project.
"Neil Munro" <[email protected]>
| Newsgroups | gmane.comp.autopackage.devel |
|---|---|
| Message-ID | <[email protected]> |
2008/6/9 Isak Savo <[email protected]>: > Resending this, since the list was down when I sent it... > > On Thu, Jun 5, 2008 at 8:52 AM, Isak Savo <[email protected]> wrote: > > On Thu, Jun 5, 2008 at 12:10 AM, Neil Munro <[email protected]> wrote: > >> > >> 2008/6/4 Isak Savo <[email protected]>: > >>> > >>> On Wed, Jun 4, 2008 at 10:33 PM, Neil Munro <[email protected]> > wrote: > >> > > >> > 2008/6/4 Isak Savo <[email protected]>: > >> > >> if (File.Exist("../../images/image.png")) > >> myImageFile = "../../images/image.png"; > >> else > >> myImageFile = Path.Combine(Binreloc.DataDir ... //etc... > >> > >> That way, it doesn't matter which compile mode you build the program > >> in, it'll always just work. > > > > I like this method. Looks like a lot of work initially, but I don't mind > too > > much. > > I agree. This is typically the solution I do. Question // Create the whitelist file. if ( sTemp == "w" ) { if ( !File.Exists( Path.Combine( BinReloc.DataDir, "whitelist.txt" ) ) ) { File.Create( Path.Combine( BinReloc.DataDir, "whitelist.txt" ) ); } vEditFilter( "white" ); } To do something like the above should it work like this: // Create the whitelist file. if ( sTemp == "w" ) { if ( !File.Exists( Path.Combine( BinReloc.DataDir, "whitelist.txt" ) ) && !File.Exists( "../share/whitelist" ) ) { File.Create( Path.Combine( BinReloc.DataDir, "whitelist.txt" ) ); } vEditFilter( "white" ); } Just a bit confused and wondering if my checks are in the right places. > > > >> > >> For 2), you'd have to setup MonoDevelop to actually copy everything to > >> a location on your disk and run it from there. This method would > >> require you to write some shell scripts. You can configure custom > >> commands by right clicking on your project file in monodevelop, select > >> properties and then navigate to > >> Configurations -> Debug (Active) -> Custom Commands. > > > > So what are the custom commands I need to set up, what do I need to copy > > where? Could I not have the folder in ../share and a sym-link that > BinReloc > > looks in? > > You would create a bash script in your source directory called, e.g. > post-build.sh > That script would typically do: > > #!/bin/sh > prefix=/tmp/myprogram-debug > mkdir -p "$prefix/bin" > mkdir -p "$prefix/share/myprogram" > #copy binary to bin > cp bin/Debug/myprogram "$prefix/bin" > #copy data to share, just use cp to copy whatever data files you need > to $prefix/share/myprogram/ > > Then you call this script from mono-develop after a successfull build > (using the options i talked about) > > But if you do solution 1) above, you don't need this script at all. > > > I have set the binary output directory to be Debug and data should be in > > share/ below that and I would like to have the binary in bin/ so what > script > > magic do I need? > > Go with 1) above and don't change anything in monodevelop! That's > probably the easiest method. > > >> I was a bit unclear, "/etc" is mostly used for system configuration > >> files. Normal applications rarely place anything there, mostly servers > >> and fundamental system tools do that. (There are a few exceptions to > >> this rule though, for example programs that use the GConf > >> configuration system, like the GNOME apps, they put their default > >> configuration values there.. but that's a completely different story.. > >> let's not go there right now :) > >> > >> Configuration files which are ment to be changed by the user should be > >> stored in the users home directory. Typically, you would store them in > >> ~/.config/yourprogram or something like that (either just one file, or > >> a directory with multiple files depending on how much configuration > >> files you need.. probably just one!) > >> > >> Anything else should most likely go to $prefix/share/yourprogram. > > > > Got ya, only really use bin and share, right? > > For most applications, yes. > > If you're really interested in how the directory layout works, you > should read up on the FHS document (Filesystem Hierarchy Standard): > http://www.pathname.com/fhs/pub/fhs-2.3.html Kinda know how it works now sticking with method one, looks the most efficient. Thanks. > <http://www.pathname.com/fhs/pub/fhs-2.3.html> > > -Isak > > --------------------------------------------------------------------- > To unsubscribe, e-mail: autopackage-dev-unsubscribe-OfajU3CKLf1/[email protected] > For additional commands, e-mail: autopackage-dev-help-OfajU3CKLf1/[email protected] > >