Hacking A by product of Crap, CrazyInstaller

WiiCrazy

Be water my friend!
OP
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
Yeah a simple by product of Crap, another useless tool to create installers for homebrew channels. Here is a few screenshots.

CrazyInstallerv0.1.JPG


Here is an example installer created,

CrapSelfInstallerv0.2.JPG


Wii side installer is the same one used in Crap.


It's bundled in Crap 3.2b, see here : Crap thread
 

damysteryman

I am too busy IRL these days...
Member
Joined
Oct 4, 2007
Messages
1,223
Trophies
1
XP
1,026
Country
Antarctica
Not useless at all!

Saves copying wads to sd and usb! I like, especially since my Wii's SD slot is acting up!
Thanks WiiCrazy!
 

Leathl

Well-Known Member
Member
Joined
Aug 15, 2009
Messages
239
Trophies
0
Location
Berlin
Website
Visit site
XP
90
Country
Gambia, The
I'm getting an error when trying to create a self installer exe ony Win 7 x64. My guess is that you compiled for "Any CPU".
As you're invoking an unmanaged 32 bit library (zlib1.dll), you need to compile for "x86" in order for it to work on 64 bit systems.
 

WiiCrazy

Be water my friend!
OP
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
Leathl said:
I'm getting an error when trying to create a self installer exe ony Win 7 x64. My guess is that you compiled for "Any CPU".
As you're invoking an unmanaged 32 bit library (zlib1.dll), you need to compile for "x86" in order for it to work on 64 bit systems.

Hmm thanks for noting that, I never used a 64 bit os hence I can't make the difference... probably thought it was happening magically
smile.gif


Better I test these applications in a virtual machine with an 64-bit os.

Could you try this one : CrazyInstaller-32bit.rar
 

Leathl

Well-Known Member
Member
Joined
Aug 15, 2009
Messages
239
Trophies
0
Location
Berlin
Website
Visit site
XP
90
Country
Gambia, The
Doesn't work.. Well, it apparently can't.
As I read from the exception, CommonHelpers.dll calls zlib1.dll, so that one (CommonHelpers.dll) must be compiled for x86.
 

WiiCrazy

Be water my friend!
OP
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
Leathl said:
Doesn't work.. Well, it apparently can't.
As I read from the exception, CommonHelpers.dll calls zlib1.dll, so that one (CommonHelpers.dll) must be compiled for x86.

Bummer, the side effect of having too many assemblies for small things, yep zlib was called from CommonHelpers
smile.gif


here included : CrazyInstaller-32bit-2.rar

By the way, do you have any idea why compiled windows form app starts with a console? (Probably you'll see that when you make an example exe)

If you are interested, here is the code that generates the executable, very simple actually.

CODEÂÂÂÂÂÂÂÂpublic static string CreateSelfInstaller(string appPath, string defaultIp, string wadName, byte[] compressedInstallerDol, int uncompressedSize, int iosToUse, string outputFilename)
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂif (appPath != String.Empty)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂDirectory.SetCurrentDirectory(appPath);
ÂÂÂÂÂÂÂÂÂÂÂÂ}

ÂÂÂÂÂÂÂÂÂÂÂÂSpitInstallerMetaData(defaultIp, wadName, compressedInstallerDol, uncompressedSize, iosToUse);

ÂÂÂÂÂÂÂÂÂÂÂÂCompilerResults cr;

ÂÂÂÂÂÂÂÂÂÂÂÂCodeDomProvider prov = null;

ÂÂÂÂÂÂÂÂÂÂÂÂprov = CodeDomProvider.CreateProvider("cs");

ÂÂÂÂÂÂÂÂÂÂÂÂCompilerParameters parameters = new CompilerParameters();
ÂÂÂÂÂÂÂÂÂÂÂÂparameters.ReferencedAssemblies.Add("system.dll");
ÂÂÂÂÂÂÂÂÂÂÂÂparameters.ReferencedAssemblies.Add("system.data.dll");
ÂÂÂÂÂÂÂÂÂÂÂÂparameters.ReferencedAssemblies.Add("System.Drawing.dll");
ÂÂÂÂÂÂÂÂÂÂÂÂparameters.ReferencedAssemblies.Add("System.Windows.Forms.dll");
ÂÂÂÂÂÂÂÂÂÂÂÂparameters.ReferencedAssemblies.Add("System.Xml.dll");
ÂÂÂÂÂÂÂÂÂÂÂÂparameters.IncludeDebugInformation = false;
ÂÂÂÂÂÂÂÂÂÂÂÂparameters.EmbeddedResources.Add("InstallerStub\\Resources\\installer.z");
ÂÂÂÂÂÂÂÂÂÂÂÂparameters.GenerateExecutable = true;
ÂÂÂÂÂÂÂÂÂÂÂÂparameters.GenerateInMemory = false;

ÂÂÂÂÂÂÂÂÂÂÂÂstring outputAssembly = wadName.Replace(".wad", ".exe");
ÂÂÂÂÂÂÂÂÂÂÂÂif (outputFilename == String.Empty)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂparameters.OutputAssembly = "wad\\" + outputAssembly;
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂÂÂÂÂelse
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂparameters.OutputAssembly = outputFilename;
ÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂÂÂÂÂList filenames = new List();
ÂÂÂÂÂÂÂÂÂÂÂÂfilenames.Add("InstallerStub\\Info.cs");
ÂÂÂÂÂÂÂÂÂÂÂÂfilenames.Add("InstallerStub\\Form1.Designer.cs");
ÂÂÂÂÂÂÂÂÂÂÂÂfilenames.Add("InstallerStub\\Form1.cs");
ÂÂÂÂÂÂÂÂÂÂÂÂfilenames.Add("InstallerStub\\Program.cs");

ÂÂÂÂÂÂÂÂÂÂÂÂcr = prov.CompileAssemblyFromFile(parameters, filenames.ToArray());

ÂÂÂÂÂÂÂÂÂÂÂÂif (cr.Errors.HasErrors)
ÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂStringBuilder error = new StringBuilder();
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂerror.Append("Error Compiling Expression: \n");
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂforeach (CompilerError err in cr.Errors)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂerror.AppendFormat("Line {0}: {1}\n", err.Line, err.ErrorText);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂthrow new Exception(error.ToString());
ÂÂÂÂÂÂÂÂÂÂÂÂ}

ÂÂÂÂÂÂÂÂÂÂÂÂreturn outputAssembly;
ÂÂÂÂÂÂÂÂ}

ÂÂÂÂÂÂÂÂprivate static void SpitInstallerMetaData(string defaultIp, string wadName, byte[] compressedInstallerDol, int uncompressedSize, int iosToUse)
ÂÂÂÂÂÂÂÂ{
ÂÂÂÂÂÂÂÂÂÂÂÂStringBuilder sb = new StringBuilder();
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("using System;\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("namespace InstallerStub\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("{\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("public class Info\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("{\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("public static string WadName = \""); sb.Append(wadName); sb.Append("\";\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("public static int UncompressedSize = ");sb.Append(uncompressedSize); sb.Append(";\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("public static int CompressedSize = ");sb.Append(compressedInstallerDol.Length); sb.Append(";\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("public static string DefaultIp = \""); sb.Append(defaultIp); sb.Append("\";\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("public static string DefaultIos = \""); sb.Append(iosToUse); sb.Append("\";\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("}\n");
ÂÂÂÂÂÂÂÂÂÂÂÂsb.Append("}\n");
ÂÂÂÂÂÂÂÂÂÂÂÂstring metaDataClass = sb.ToString();

ÂÂÂÂÂÂÂÂÂÂÂÂFile.WriteAllText("InstallerStub\\Info.cs", metaDataClass);
ÂÂÂÂÂÂÂÂÂÂÂÂFile.WriteAllBytes("InstallerStub\\Resources\\installer.z", compressedInstallerDol);

ÂÂÂÂÂÂÂÂ}
 

Leathl

Well-Known Member
Member
Joined
Aug 15, 2009
Messages
239
Trophies
0
Location
Berlin
Website
Visit site
XP
90
Country
Gambia, The
It still gives me the same error. I don't know if every part that's involved must be compiled for x86 only
unsure.gif


As for the console popping up, add this line:

Code:
parameters.CompilerOptions = "/target:winexe";
 

WiiCrazy

Be water my friend!
OP
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
Leathl said:
It still gives me the same error. I don't know if every part that's involved must be compiled for x86 only
unsure.gif


As for the console popping up, add this line:

Code:
parameters.CompilerOptions = "/target:winexe";

Well my mistake, it seems I selected x64 when I intended to select x86... btw there is no x86 in my build target list, there is win32 though.
WiiHelpers.dll was omitted, I included that too. This time it should run ok I guess..

Here is a standalone one without Crap : CrazyInstaller-v0.1.rar

Thanks for the compiler options tip btw!
 

WiiCrazy

Be water my friend!
OP
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
Leathl said:
Still the same
blink.gif


Here's the error + solution: http://blog.mstern.at/index.php?/archives/...mpiled-dll.html
What IDE are you using when you say you ain't got the x86 option?

Hmm, I've changed the target for the solution actually, there is no x86 selection there... In the projects build settings in fact there is x86... I recompiled, hope it works now...

http://www.tepetaklak.com/data/CrazyInstaller-v0.1.1.rar

ps: I'm using VS2008 btw, I really need to create a vm to test for 64-bit it seems...
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AngryCinnabon @ AngryCinnabon: anything that offers trump an opportunity to become an actual dictator is bad in my book, i...