lunedì 31 ottobre 2011

Pimp Your Pumpkin

This Halloween, pimp your pumpkin.
Choose the shape, eyes, nose and mouth you like.
Scare your friends!
 
 

 

mercoledì 26 ottobre 2011

CREATING AN AUTORUN CD/DVD IN SILVERLIGHT WITH EXTERNAL ASSETS

One task I had to deal with recently was the creation of an autorun dvd, starting from our out-of-browser Silverlight 4 project. After some research I ended up on this post (thanks Tim Heuer) which was really useful, but anyway I decided to post my own solution since it involved a few differences I couldn't find anywhere on the net.

Our client needed to include several video files in the dvd, loaded dinamically in a MediaElement in some of the pages. We didn't want to include these videos in the xap package by setting their Build Action as Content or Resource, because that made the xap file very big, and it really took a lot every time we built the project in Visual Studio. So I put them in a subfolder of the ClientBin directory in the "Web" project of the solution, with their Build Action set to "None".

Here's how solution explorer looked.



All I needed now was to reference them properly in the code, and I managed to do that by setting the source of the MediaElements to "/Assets/Video/[filename].wmv". I still can't explain how - it always takes a bit of "magic" for Visual Studio to find the files at execution time, so if you don't get it at the first time don't give up - but finally I made it work. Just make sure this works for you as well before going on, you can find plenty of articles about this if you have a look around.

Then I compiled the project and copied the xap file and sllauncher.exe to a new folder on my desktop - you can find sllauncher.exe in your "\Microsoft Silverlight" subfolder in Program Files (or "Program Files (x86)" if you're working on a 64-bit version of the OS). Imagine the new folder is the root directory of the dvd: you also need to copy the videos in the correct subfolder, which for me was "\Assets\Video\". Notice there is no need of starting with "\ClientBin\", because when you build the output xap file is automatically put under ClientBin - it's like the root of the dvd IS your ClientBin.

Finally I created an Autoplay.bat to call sllauncher.exe with the parameters required. We needed the application to run directly from the dvd without installing, so I used /emulate along with the /origin and /overwrite parameters as explained in Tim Heuer's post. I also added an autorun.inf file to start Autoplay.bat automatically upon the insertion of the dvd, I will explain how to do it later in this post.

Everything seemed to be in its right place, but when I tried launching the Autoplay.bat it didn't work at all.
While developing the project I previously had to deal several times with the problems of changing the source of a MediaElement, and since most of the times the issue was path-related I guessed that was the case. But I necessarily had to use a relative path (that "/Assets/Video/
[filename].wmv" I talked about earlier) starting from the root of the dvd where I planned to put my xap file, so I tried to build the path from code by combining my relative uri with the Application.Current.Host.Source uri. No luck. After a lot of searching and trying with the help of one of my colleagues (thanks Gianpaolo) I still had no clues on what I was doing wrong. Actually, that relative path I used was right from the beginning, so you want to leave it in the form "/Assets/Video/[filename].wmv".

Finally we started asking ourselves if the problem was in the way I launched the application with sllauncher, and that was it. In particular, it was in the /origin parameter. This is a mandatory parameter, and you need to set the origin to a formally-correct URI, otherwise sllauncher will just fail execution with an error. The origin should actually be set to a real URI endpoint online: that way - even if I never tried this myself - the installed Silverlight application should update by itself anytime you publish an update to that URI.
So this is actually a really cool feature, but I didn't really need it. In my case, since the xap package location was on a dvd and there won't be any further updates for the application, I had linked the origin to a fake (but formally-correct) location online. What I didn't know is that the origin I specified when I invoked sllauncher.exe became the path of execution of the application, so my app was looking for the external assets by starting from the fake location I had entered, plus the relative path in the code! The whole uri of a single video must have been changed automatically into something like this:
"http://www.somewebsite.com/somefolders/.../Assets/Video/
[filename].wmv".

So I changed the origin to "file:///[xapFile].xap", created the iso, mounted it on a virtual drive and it worked!


Now, to sum things up a bit... these are the steps I followed to make it work.

- Put your external assets under ClientBin in your ".Web" project (you can also create subfolders, in my case it was /ClientBin/Assets/Video/) and set their Build Action to "None".

- Refer to your assets in code with a relative path, assuming ClientBin is your root directory (in my case the path was "/Assets/Video/
[filename].wmv", remember to use the initial "/").

- Try compiling and executing to be sure the assets are loaded correctly; if not, you have path issues that you should solve from within Visual Studio before proceeding further. You can find many resources online that can help you to achieve this.

- Create a new folder anywhere on your hard-drive, and copy-paste the content of the ClientBin folder from your ".Web" project into it - it should contain the generated xap file and your assets within their subfolders. Also copy-paste sllauncher.exe into it, and create two new files: "Autoplay.bat" and "autorun.inf".

- Edit "autorun.inf" to launch "Autoplay.bat" with the following code:

[autorun]
open = Autoplay.bat

- Edit "Autoplay.bat" to execute sllauncher.exe with the following code (remember to replace
[xapFile] with the name of your xap file in both the /emulate and /origin parameters):

sllauncher.exe /emulate:"[xapFile].xap" /origin:"file:///[xapFile].xap" /overwrite

Your new folder should now look like this:



- Now create a cd/dvd image file with any cd/dvd burning program, and put the content of this folder into the root of the cd/dvd. Then mount the image file on a virtual dvd drive and everything should work fine.

Please note that if you launch the Autoplay.bat manually from your folder on the desktop it still WON'T work, because "file:///" relates to the root folder of the drive you're launching the application from. Suppose that the user's dvd drive is "F:", the path "file:///
[xapFile].xap" would be translated into "F:\[xapFile]
.xap", which is exactly the path of your xap file in the root folder of the dvd. So you need to create the dvd image file and burn it/mount it on a virtual drive to test it properly. Alternatively, you can try to copy the content of the folder in the root of a USB pen drive and launch Autoplay.bat manually from there.

I hope you found this useful, please leave comments or send me an email if you have any questions.

Giovanni Peroni.


lunedì 17 ottobre 2011

Scopa e Briscola

Da oggi Scopa e Briscola in un unico pacchetto: i due giochi di carte più tradizionali in Italia al prezzo di uno!

Potrai giocare in due – uno contro uno – o in quattro a coppie; puoi decidere liberamente quanti giocatori lasciare al controllo del computer, e giocare con gli amici sul tuo cellulare.

Ci sono due modalità di gioco: torneo e partita veloce. Ogni partita interrotta viene salvata automaticamente, per non farti perdere neanche un minuto di divertimento.
Decidi quale aspetto dare al tuo gioco scegliendo il mazzo e lo sfondo.

Ti sei dimenticato a casa le carte? "Scopa e Briscola" è ciò che fa per te!

Caratteristiche
Lingue: Inglese – Italiano – Spagnolo
Per due, tre o quattro giocatori, umani o controllati dal computer.
Due modalità di gioco: torneo o partita veloce.
7 diversi sfondi e 6 mazzi di carte (napoletane, siciliane, piacentine, bergamasche, bolognesi e romagnole).
Salvataggio automatico della partita.
Pienamente compatibile con Mango.

domenica 16 ottobre 2011

Mistero svelato

Sono passati soli 3 giorni da questo Post ed ora è già finito e pronto a sbarcare sul marketplace.
Cos’è? Ma è Hexagon!!!

Ispirandoci a questo gioco (questa è una copia dell’originale) abbiamo ben pensato di riproporlo anche noi.


 
Bello vero!??!
Se vi trovate per le mani un windowsphonino provatelo o consigliatelo ai vostri amicici.
A breve la versione web!!!

giovedì 13 ottobre 2011

OltreZune

Da qualche settimana è stato aperto il portale del Marketplace per Windows Phone 7.
Nei primi giorni indovinate cosa abbiamo trovato nei Giochi in primo piano? 



Senza dubbio ci ha fatto molto piacere e speriamo di poterci tornare con qualche altro titolo.
In ogni modo, se volete dare un’occhiata alle nostre applicazioni potete andare anche qui

Sta arrivando!!!

Nome in Codice: Bee hive project


Da ieri notte è in cantiere un nuovo progetto.
Non vi sveliamo altro per il momento ma prossimamente verranno inseriti nuovi screenshot e qualche altro indizio.
Stay tuned

sabato 1 ottobre 2011

Mahjong

Nell’attesa che il nostro prestigioso e atteso Mahjong approdi sul Marketplace, in esclusiva per i fans di Carousel Team ecco la versione giucabile online.

PROVILO  (Clicca li)




 Poi diteci cosa ne pensate qui sotto.   


Fb: da Gruppo a Pagina


Visto il seguente avviso trovato nella parte superiore della sezione amministrazione del gruppo facebook :

È prevista l'archiviazione di questo gruppo
Nei prossimi mesi, Facebook archivierà tutti i gruppi creati usando il vecchio formato. In base alla tua richiesta, continuerai a far parte di questo gruppo anche in seguito all'archiviazione.

Si annuncia il passaggio “forzato” dal gruppo


Alla nuova pagina

Carousel Team Page


 
Chiunque sia interessato può continuare a seguirci sulla nuova pagina. Grazie!