Version française
Home     About     Download     Resources     Contact us    
Browse thread
Building multiple configurations?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Grant Olson <kgo@g...>
Subject: Re: [Caml-list] Building multiple configurations?
On 3/22/2010 9:56 PM, Yoann Padioleau wrote:
> 
> Apparently it's a boolean since you support only 2 different configs ...
> 
> 
> let config1 = {
>  field1 = 1;
>  field2 = true;
> }
> 
> let config2 = {
>  field1 = 2;
>  field2 = true;
> }
> 
> (* settable via command line or config file *)
> let config = ref true 
> 
> let current_config () = 
>  if !config then config1 else config2
> 
> ...
> 
> let main = 
>  let args = [
>  "-config1", Arg.Set config, "";
>  "-config2", Arg.Clear config "";
>  ]
>  in
>  Arg.parse ... blablabla
> 
> 

This is getting a off topic for this list, but it's a usability issue,
not so much a technical one.

Most users will be windows users who double-click on the icon to run it.

I could create a batch file that calls the real .exe with the config
switch to activate the alternate config, but is a user going to click on
the pretty executable file with the custom icon, or the ugly batch file
icon?

I could create a stub executable to call the real one so I can get a
pretty icon, but then people will wonder why the stub breaks when they
copy it somewhere else and don't move the real executable.

I could do some black magic and detect the executable name at runtime,
and set the config based on that, but there's no reason someone
shouldn't be able to hit F2 and rename the file.

So I'd rather just have two stand-alone executables that contain
everything they need.