New Allegiance installer

Catch-all for all development not having a specific forum.
pkk
Posts: 5419
Joined: Tue Jul 01, 2003 7:00 am
Location: Germany, Munich

Post by pkk »

I found a solution for that problem, somehow:

CODEName "Detect Visual C++ 2008 Redist"
OutFile "DetectVS90.exe"

!include "Registry.nsh"

Section
; possible search strings: "Microsoft Visual C++ 2008 ATL Update kb973924", "Microsoft Visual C++ 2008 SP1 Redistributable", "Microsoft Visual C++ 2008 Redistributable"
${registry::Open} "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" "/K=0 /V=0 /S=1 /B=1 /NI='Microsoft Visual C++ 2008' /T=REG_SZ" $0
StrCmp $0 0 0 loop
MessageBox MB_OK "Error" IDOK close

loop:
${registry::Find} "$0" $1 $2 $3 $4

MessageBox MB_OK 'path=[$1]$\nvalue=[$2]$\nstring=[$3]$\ntype=[$4]'
close:
${registry::Close} "$0"
${registry::Unload}
SectionEnd

At least it's better than hardcoding product keys... :unsure:
Last edited by pkk on Sat Oct 16, 2010 8:18 pm, edited 1 time in total.
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
lexaal
Posts: 2612
Joined: Sun Oct 07, 2007 12:58 pm

Post by lexaal »

pkk wrote:QUOTE (pkk @ Oct 16 2010, 10:15 PM) At least it's better than hardcoding product keys... :unsure:

Code: Select all

#include <windows.h>
#include <stdio.h>
int main()
{
    int ret=-1000;
if ((LoadLibrary("msvcr100.dll")!=NULL)) // depends on MSVS-version
{
  printf("vcc intstalled");
  ret=0;
}
else {
    printf("vcc not installed");
    ret=1;
    }
return ret;
}
I have a johnson photo in my profile since 2010.
pkk
Posts: 5419
Joined: Tue Jul 01, 2003 7:00 am
Location: Germany, Munich

Post by pkk »

Currently testing a installer, which already has contains needed Visual C++ dlls (like during the old installers), so you don't need to install redistributable.

If it works, it will remove the main issue, because .net framework and DirectX installer are not language specific.
Last edited by pkk on Mon Oct 18, 2010 6:55 pm, edited 1 time in total.
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
the.ynik
Posts: 101
Joined: Fri Apr 17, 2009 7:23 pm
Location: Germany

Post by the.ynik »

pkk wrote:QUOTE (pkk @ Oct 16 2010, 08:37 PM) I ran into problems with detecting VC2008 Redistributables.

Using registry keys to detect them was a bad idea, because every localized version uses a different product uninstall keys... :sad:

I got already 6 VC2008 Redist keys, just for the english version. :P

If anyone got an idea, let me know.
I've had similar problems in the past, the VS2008 redist is impossible to detect correctly. Mind that it can also be partially installed - applications can choose to install only the parts they need.

I ended up checking for the existance of HKLM\SOFTWARE\Microsoft\DevDiv\VC\Servicing\9.0 OR the presence of .NET 3.5 SP1 (which includes the VC runtime but doesn't set the first registry key). This catches most (but not all) situations where the VC runtime is already installed.

But if it's in any way possible with NSIS, you should use the merge modules as AEM said. Only the merge modules will increase the reference count on the VC runtime so that uninstalling the program that first installed the VC runtime doesn't break Allegiance.
pkk
Posts: 5419
Joined: Tue Jul 01, 2003 7:00 am
Location: Germany, Munich

Post by pkk »

Seems like I got Allegiance working without installing VC2008 Redistributable...

fresh install on VirtualPC & VirtualBox, Windows XP SP2 german:
Without local dlls Allegiance won't run at all, no logfile, nothing.
After putting them into Allegiance folder, Allegiance crashs, but creates log files.
Reason for crash: both don't support D3D (depending on logfiles)

my machine, Windows 7 Professional x64 english:
No problems running Allegiance with local dlls. (I haven't uninstalled redistributable.).

If someone has a VM with supports D3D or reinstalls his PC, feel free to test the installer. It should work on blank Windows XP SP2 (or better) system, it starts download of .net framework 2.0 and download of DirectX (if not updated).

Download link:
http://www.german-borg.de/files/Allegiance%20Setup%20new.exe
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
the.ynik
Posts: 101
Joined: Fri Apr 17, 2009 7:23 pm
Location: Germany

Post by the.ynik »

pkk wrote:QUOTE (pkk @ Oct 18 2010, 10:29 PM) If someone has a VM with supports D3D or reinstalls his PC, feel free to test the installer. It should work on blank Windows XP SP2 (or better) system, it starts download of .net framework 2.0 and download of DirectX (if not updated).

Download link:
http://www.german-borg.de/files/Allegiance%20Setup%20new.exe
VirtualBox 3.2.4, Windows XP SP2 German.
Completely fresh Windows installation with only the VirtualBox guest extensions installed (experimental D3D support enabled).

1) When launching alleg setup, I get a message
---------------------------
Free Allegiance Setup
---------------------------
Can't find DirectX 9.0c SDK (March 2009).

Press OK to start installer.
---------------------------
OK
---------------------------


That message is misleading, you're not installing the SDK, only the DirectX optional runtime components. You might want to clarify that wording.
Also, you should add a sentence that it's possible and necessary to install that package even if DirectX10/11 is installed. Otherwise users might be worried their DirectX11 gets damaged.

2)
After DirectX 9.0c is installed, I get the message:

---------------------------
Free Allegiance Setup
---------------------------
Free Allegiance requires the Microsoft .NET framework version 2.0.

Download and install it in your operation system language version!

Note:
.net Framework 3.x or 4.x are no upgrades of 2.0, they are just different runtime environments.
Press OK to open download page.
---------------------------
OK
---------------------------

Actually, .NET Framework 3.x is an upgrade of 2.0, but 4.0 isn't. Microsoft really maximized the confusion here. I also like the fact that 3.5 SP1 is not a service pack but a new version that adds major features, and the confusingly named "3.5 SP1 GDR" is the actual service pack.
Here's a mapping MS Name -> how I would have named it.
.NET 2.0 -> .NET 2.0
.NET 3.0 -> .NET 2.1
.NET 3.5 -> .NET 2.2
.NET 3.5 SP1 -> .NET 2.3
.NET 3.5 SP1 GDR -> .NET 2.3 SP1

But I'm getting off-topic and the .NET 2.0 download on my VM is done, so...

3) I can't install .NET 2.0 because I'm missing Windows Installer 3.1. The .NET 2.0 setup just exits without giving me a download link.
Not nice, but this should happen only on a very fresh WinXP SP2 (without any Windows Updates), so the vast majority of users shouldn't run into trouble here.

So off to manually download and install Windows Installer 3.1.
One reboot later I re-launch the Allegiance Setup.

4) Allegiance tries to download .NET 2.0 again, but it's still in the browser cache so the installer launches almost immediately.
Fortunately Allegiance only needs .NET 2.0, with .NET 3.5 I'd now be prompted to separately install the "Windows Imaging Component".

The .NET installer takes some time (especially in a VM, as disk access is extra slow there), so I'll take a break...

5) .NET is installed successfully. Allegiance installer doesn't continue automatically, I have to re-launch it.

6) I install Allegiance with default options.

7) ASGS launches OK, but I can't use it to connect as "Client submitted an invalid key" - I guess this is to be expected in a virtual machine.

8) Allegiance.exe can't start:

Code: Select all

Direct3DCreate9 succeeded.
Pure HWVP device creation failed: 0x8876086c.
HWVP device creation failed: 0x8876086c.
SWVP device creation failed: 0x8876086c.
I guess the VirtualBox Direct3D mode doesn't work - but if it got this far, then the C++ runtime and DirectX components were loaded correctly.

So it's a nice improvement over our current setup :iluv:
pkk
Posts: 5419
Joined: Tue Jul 01, 2003 7:00 am
Location: Germany, Munich

Post by pkk »

the.ynik wrote:QUOTE (the.ynik @ Oct 18 2010, 11:16 PM) 3) I can't install .NET 2.0 because I'm missing Windows Installer 3.1. The .NET 2.0 setup just exits without giving me a download link.
Not nice, but this should happen only on a very fresh WinXP SP2 (without any Windows Updates), so the vast majority of users shouldn't run into trouble here.

So off to manually download and install Windows Installer 3.1.
One reboot later I re-launch the Allegiance Setup.
That's correct, Windows XP SP2 doesn't have Windows Installer 3.1. I had to download it myself. ;)

Like you, I don't think it's a problem.

the.ynik wrote:QUOTE (the.ynik @ Oct 18 2010, 11:16 PM) 5) .NET is installed successfully. Allegiance installer doesn't continue automatically, I have to re-launch it.
Added another message box, so people know they have to restart the installer... I'm not sure, if it should continue automaticly (since there are people without broadband).
the.ynik wrote:QUOTE (the.ynik @ Oct 18 2010, 11:16 PM) 7) ASGS launches OK, but I can't use it to connect as "Client submitted an invalid key" - I guess this is to be expected in a virtual machine.
Correct.
the.ynik wrote:QUOTE (the.ynik @ Oct 18 2010, 11:16 PM) 8) Allegiance.exe can't start:

Code: Select all

Direct3DCreate9 succeeded.
Pure HWVP device creation failed: 0x8876086c.
HWVP device creation failed: 0x8876086c.
SWVP device creation failed: 0x8876086c.
I guess the VirtualBox Direct3D mode doesn't work - but if it got this far, then the C++ runtime and DirectX components were loaded correctly.
I ended up with the same problem on my VMs... ;)
the.ynik wrote:QUOTE (the.ynik @ Oct 18 2010, 11:16 PM) So it's a nice improvement over our current setup :iluv:
Thanks for testing. :iluv:
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
lexaal
Posts: 2612
Joined: Sun Oct 07, 2007 12:58 pm

Post by lexaal »

I'm testing it on a xpSP3 VM right now.

Installation runs smooth but ASGS shows an OOBE error. (damn how do i become admin in vista..)

manual opening the exe results in -> (I assume a typical VM error)
QUOTE Log file DeviceCreation.log created - Oct 20, 02:31
CD3DDevice9 initialised.
Direct3DCreate9 succeeded.
Pure HWVP device creation failed: 0x8876086c.
HWVP device creation failed: 0x8876086c.
SWVP device creation failed: 0x8876086c.
Device creation finished.[/quote]

Notes:
#1 If directX or .net or.. is missing, it shows an "error" message. I bet that many people think it is an error and skip install. Rather show: Install directX yes/no dialogs, or make it part of the checkboxlist where the user chooses to install the msvc-runtimes and the ogg files.

#2 no automated/silent install.
Last edited by lexaal on Wed Oct 20, 2010 12:35 am, edited 1 time in total.
I have a johnson photo in my profile since 2010.
pkk
Posts: 5419
Joined: Tue Jul 01, 2003 7:00 am
Location: Germany, Munich

Post by pkk »

lexaal wrote:QUOTE (lexaal @ Oct 20 2010, 02:26 AM) Installation runs smooth but ASGS shows an OOBE error. (damn how do i become admin in vista..)
You always get OOBE error on first launch of ASGS on Vista/Win7, but you should be able to logon.
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
Dorjan
Posts: 5024
Joined: Sun Oct 07, 2007 9:56 am
Location: England

Post by Dorjan »

(I just want to say, I've not tested this yet, but <3 PKK for doing this long overdue thing for alleg. Mucho respecto)
I decided to relive the days gone by in my new blog.
---
Remember, what I say is IMO always. If I say that something sucks, it actually means "I think it sucks" OK?
Cookie Monster wrote:QUOTE (Cookie Monster @ Jan 31 2012, 03:09 PM) True story.

Except the big about dorjan being jelly, that's just spidey's ego.
ImageImage
Post Reply