.exe file sharing

.exe file sharing
0

I wanted to see if my game is playable by others. So I emailed the exe to somebody. He sent me this video, as it did not work. Is this something bad? (I figured an exe is an exe, as long as the other uses windows it should be fine. Am I wrong?)

I believe your game needs some external resources and/or other libraries to run. Because I can’t see your video, it’s not possible to give a better answer.

Yes @mars3142 is right. You need to use an installer and package everything up or install the visual studio redistributable libraries. For example: https://www.microsoft.com/en-us/download/details.aspx?id=48145

Without this, the exe will only run on my PC?

I guess you can statically link also.

Make sure you build your app in ‘Release’ mode, otherwise you’ll end up having dependencies on debug libraries, for which there are no redistributables. If you absolutely must build it in debug mode, then you will need to manually include debug libraries with your app (meaning copy them into the folder where your app EXE resides before packaging them up with an installer).

After you build in release mode, it’s best you use an installer, as slackmoehrle mentioned. A relatively easy and free one to use is Inno Setup.

Here’s an installer script that will work in Inno Setup. Just replace the relevant parts:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Game"
#define MyAppVersion "0.1"
#define MyAppPublisher "PublisherName"
#define MyAppURL "www.yourdomain.com"
#define MyAppExeName "MyGame.exe"
#define MyAppDataFolder "MyGame"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={A957B1B5-1F55-4497-B1F0-812EDB3C066B} ; ** IMPORTANT, GENERATE YOUR OWN GUID **
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename=MyGameSetup
; Password=AnInstallPasswordIfRequired; Uncomment this if you want an install password
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "C:\SamplePath\win32_build_folder\MyGame\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[UninstallDelete]
Type: filesandordirs; Name: "{localappdata}\{#MyAppDataFolder}"
1 Like

Thank you ever so much. I probably know the answer already but just to be sure, does it matter WHEN I run my software with Inno Setup? As in can I build it in debug mode for the next, say 3 months, then at the last day (publish day), build it in release mode?

Inno Setup has nothing to do with your development process. It is simply a utility you use to put your files into an install package (think of it as an archive of all the files in your application).

Whether you build debug, release or otherwise is completely irrelevant.

When you are ready to distribute your application, open up Inno Setup, adjust the install script for how you want it, and run that script. All it does is grab all the relevant files you have referenced in your script and package them up into an installer. Look at the [Files] section of the script.

I think it’s too complex for him to use one more new tool.
Just archive your game to zip.
It’s much easier.

1 Like

If you want to test your game by others then APK is the best and easiest option out there.

Agreed dimon4eg, that’s an easier solution.

I am imminent to this stage now, i think I’ll use your method R101, just wanted to make sure. When you distribute your game are all UserDefaults resetted?

Yes they are. Userdefaults are specific to the device it is played on.

Now, you could always create UserDefaults on first launch and also populate some initial defaults at that same time.

If you don’t pre-populate a empty version is created and then defaults added as your game creates them.

thank you for informing me.

can i use the built in windows program called IExpress?

scroll down to find it

You can use whatever you want. Perhaps choose the one you think you can learn the easiest.

I suppose that’ll be inno due to its wide recognisability. Do i need to reposition any files before running the compiler? such as the .exe, or shall i leave everything where it is (I will likely have another question after this as this stage is incredibly critical, and one blunder may obliterate all my previous hard work)

Just leave your files where they are and when you make the installer, pick each file from where it is located. Also, if you are not using version control already you should be doing so. I prefer GitHub, but there are many others out there to look at.

i will take that into consideration, finally, analysing @R101 s example, is there anything not in a hashtag i should alter to the code?

(sorry for asking another question seperately, i have no publish will in my posts)

Do you set up the .exe’s icon in inno setup, and what dimensions do you reccomend when making an app icon?