{"id":631,"date":"2013-11-17T18:34:38","date_gmt":"2013-11-17T17:34:38","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=631"},"modified":"2013-11-18T07:56:40","modified_gmt":"2013-11-18T06:56:40","slug":"xna-game-how-to-distribute","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=631","title":{"rendered":"XNA Games : how to distribute with Inno Setup"},"content":{"rendered":"<p>So now you have made this sweet little XNA game of yours and you want to distribute it to friends.<\/p>\n<p>Sure you could give them the content of your debug\/release folder but thats a lot of files in there may be not needed for simple execution.<br \/>\nNot to mention you would like to distribute the XNA run time with it.<br \/>\nWhy not package all this in a friendly setup that allow one to install\/deinstall?<\/p>\n<p>Well lets use <a href=\"http:\/\/www.jrsoftware.org\/download.php\/is.exe\" target=\"_blank\">Inno Setup<\/a>.<\/p>\n<p>Bere below a script that will allow you to make one standalone package handling it all.<\/p>\n<p>Adapt paths and filenames to your project.<\/p>\n<p><code><br \/>\n[Files]<br \/>\nSource: XNA_BASE1.exe; DestDir: {app}<br \/>\nSource: *.dll; DestDir: {app}<br \/>\nSource: xnb\\*; DestDir: {app}\\xnb<br \/>\nSource: xnafx40_redist.msi; DestDir: {tmp}; Flags: deleteafterinstall<br \/>\n[Icons]<br \/>\nName: \"{group}\\Shooting\"; Filename: \"{app}\\XNA_BASE1.exe\"; WorkingDir: \"{app}\"<br \/>\nName: \"{group}\\Uninstall Shooting\"; Filename: \"{uninstallexe}\"<br \/>\n[Run]<br \/>\nFilename: {tmp}\\xnafx40_redist.msi; Check: ask_; Flags: shellexec waituntilterminated; StatusMsg: \"running\"<br \/>\n[Code]<br \/>\nfunction Ask_():Boolean;<br \/>\nbegin<br \/>\n result:=false;<br \/>\n  if MsgBox('Install XNA Runtime? Needed to run the game', mbConfirmation, MB_YESNO) = IDYES then  result:=true<br \/>\n  end;<br \/>\n[Dirs]<br \/>\nName: {app}\\xnb<br \/>\n[Setup]<br \/>\nAppName=Shooting<br \/>\nAppVersion=1.0<br \/>\nDefaultDirName={pf}\\shooting<br \/>\nDefaultGroupName=Shooting<br \/>\nUninstallDisplayIcon={app}\\uninstall.exe<br \/>\nCompression=lzma2<br \/>\nSolidCompression=yes<br \/>\nSourceDir=C:\\Projects\\XNA_DEMO_12_shooting\\XNA_BASE1\\bin\\Debug<br \/>\nOutputDir=C:\\Projects\\XNA_DEMO_12_shooting\\installer<br \/>\n<\/code><\/p>\n<p><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno1-300x179.png\" alt=\"inno1\" width=\"300\" height=\"179\" class=\"alignnone size-medium wp-image-634\" srcset=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno1-300x179.png 300w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno1.png 770w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno2-300x179.png\" alt=\"inno2\" width=\"300\" height=\"179\" class=\"alignnone size-medium wp-image-633\" srcset=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno2-300x179.png 300w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno2.png 770w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno3-300x179.png\" alt=\"inno3\" width=\"300\" height=\"179\" class=\"alignnone size-medium wp-image-632\" srcset=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno3-300x179.png 300w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/11\/inno3.png 770w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So now you have made this sweet little XNA game of yours and you want to distribute it to friends. Sure you could give them the content of your debug\/release folder but thats a lot of files in there may be not needed for simple execution. Not to mention you would like to distribute the <a href='https:\/\/labalec.fr\/erwan\/?p=631' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,35],"tags":[],"class_list":["post-631","post","type-post","status-publish","format-standard","hentry","category-dotnet","category-xna","category-34-id","category-35-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=631"}],"version-history":[{"count":6,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/631\/revisions"}],"predecessor-version":[{"id":644,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/631\/revisions\/644"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}