Old 3rd June 2014, 21:36   #1
edouardo17
Junior Member
 
Join Date: Jun 2014
Posts: 8
Question Looking for a bit of help

Hi everybody,

NB : If you can't be bothered to read the whole thing, just read after the 'red line'

This is my first post on that Forum, and it comes as I'm desperate for help.
I've been trying for days to figure out a way through my problems, but it seems I don't have enough experience.
I'm looking into creating an installer for very specific purposes, but let me explain; I'll try to make it as clear as possible.

I'm sure some of you already know Microsoft Flight Simulator X. With that simulator, you can download and install new planes, and in order to be able to fly with different companies, you can also install new textures for the plane different plane models.
I'm the kind of guy who designs and creates textures, and I then upload them on the internet for the community to download them.
However, my uploads aren't anything like an easy installer that does all the job for you... People still have to do it the 'old' way to install new textures, and I'm willing to get to the next level, and create installer for the texture I make.

I'm not the first to do this, and already some professional plane editors made their textures for their customers, and delivered it as an automatic installer. And that's where I've been looking so far. The publisher I'm talking about is called Wilco Publishing.

So what I've done is download one of their installer, and tried to figure out a way to extract the script in order to re-compile an installer with my own texture in it. I wasn't successful though
I know they are using NullSoft Install System V2.06 (because it's written somewhere when you go through the installation process), and I've used Universal Extractor to see what it was actually doing.

Let me explain what the installer is supposed to do:

1- Copy a whole texture folder into an existing folder (C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\SimObject\Airplanes\feelThere PIC A333GE)
(so far so good), but here comes the tricky part:

2- There are some lines to add in an aircraft.cfg file already existing as well, but depending on how many textures are already installed in the plane's folder (feelThere PIC A333GE), the lines to add aren't gonna be the same.

I'm not going to give any further details for now, it would do more arm than good...

Now the thing is, thanks to Universal Extractor, I have found a way to make life easier.
When I looked at the files extracted, there was the usual textures file for the simulator to apply the texture on the plane, AND two other files:

a - An executable called pman_airbus
b - An .ini file containing the lines to add in the aircraft.cfg file.

And when I execute the pman_airbus.exe, the lines I want eventually appear on the aircraft.cfg file, in other words, it does exactly what I'm looking for! So I deduced that the executable used the .ini file to know what lines to add to the aircraft.cfg.

So to conclude, here is what I'd need the installer to do.

First, copy a folder in a given location, containing all the texture files + the so called pman_airbus executable + the .ini file.

Then execute the pman_airbus.exe (with the livery.ini located in the same folder as pman_airbus)
(So now the lines are correctly added to the aircraft.cfg)

And to finish with, erase both pman_airbus.exe AND livery.ini so that the user aren't going to be able to execute it again (it would creates conflicts in the textures names...)


So if anyone could help me out with this, I'd be grateful for these installers are worth a lot to me! I'd even be ready to give a financial compensation if someone is interested in writing a script for me.

I've also thought about extracting the script of an existing installer (the one I was talking about just above), but I haven't managed to make NSI Decomp work, so I've been stuck ever since...

If it's not illegal, and if someone knows how to do this, I'd me more that interested in getting the script of this installer. I think that from this, I could manage re-compiling a new installer myself (or at least I hope I could).
If anyone can extract a script for me, I give you the direct link to download the texture installer: click here

Many thanks in advance for your help,

Best Regards,

Edouard
edouardo17 is offline   Reply With Quote
Old 5th June 2014, 07:32   #2
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 531
Send a message via ICQ to T.Slappy
Hmmm the installer you require is not complicated at all.
You need to extract some files and made changes in configuration (aircraft.cfg file)

The catch is in using file pman_airbus.exe you mentioned - is this your application or is it some 3rd app used for configuring the game?

However there are some extractors which can extract files from NSIS installers there is no way how to extract script from a NSIS installer.
AND using such (extracted) files from 3rd party installers is really grey zone...

Maybe you could write the same with NSIS. It is capable of reading/writing INI files (if the .cfg file is INI based) or also regular byte-by-byte reading and writing.

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 5th June 2014, 11:16   #3
edouardo17
Junior Member
 
Join Date: Jun 2014
Posts: 8
Quote:
Originally Posted by T.Slappy View Post
pman_airbus.exe - is this your application or is it some 3rd app used for configuring the game?
First of all, thanks for your reply!
To answer your question above, it actually isn't quite either of those... or may the second option...

I'm not asking my installer to install an actual program with a main executable to launch it and so on, but just to extract some files (I'm obviously talking about the textures files needed to create a model of the plane), in addition to the so called pman_airbus.exe that needs to be executed by the program in order to add the code-lines in the aircraft.cfg

To put it in simple words, instead of asking the customer to go in the folder by himself, and double-click on pman_airbus.exe, I'd need the NSIS installer to 'double-click' on pman_airbus instead of the customer

Hope you got that alright!
And what would be even better is if the NSIS installer could then erase the pman_airbus.exe so that the customer cannot launch it again, which would create conflicts as I said above... But don't worry about this bit

How could I do something like this?

I saw in your signature that you actually offer NSIS scripting, and pretty sick graphical installer? Is that something you do? Because I would be very interested in having a personalised installer! In other words, could you help me out through this small project? For a financial compensation of course...
edouardo17 is offline   Reply With Quote
Old 5th June 2014, 13:19   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,150
Where did pman_airbus.exe come from? You cannot just use some software you found in your installer if you don't know the license etc...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 5th June 2014, 19:49   #5
edouardo17
Junior Member
 
Join Date: Jun 2014
Posts: 8
Hi Anders,

I hope I didn't mis-understood your message, but if I did understand it correctly, here is my answer:

I've been in contact with the Flight Simulator add-on editor who made these installers to see if they were able to give me the NSIS script, but unfortunately, the guy who made these installer is not working for them anymore.

However, I have their full authorisation to use anything that I can find in their installer, including the pman_airbus.exe of course.
I can certify that I've asked them, and I got their approval
edouardo17 is offline   Reply With Quote
Old 5th June 2014, 20:10   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,150
Something like this maybe:
Quote:
Var flightsimroot
Section
StrCpy $flightsimroot "c:\????" ; Find this path in the registry?
SetOutPath "$flightsimroot\SimObject\Airplanes\feelThere PIC A333GE"
File "pman_airbus.exe"
File "inidata.ini"
ExecWait '"$outpath\pman_airbus.exe"'
Delete "$outpath\pman_airbus.exe"
Delete "$outpath\inidata.ini"
SectionEnd

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 5th June 2014, 20:44   #7
edouardo17
Junior Member
 
Join Date: Jun 2014
Posts: 8
I'm maybe gonna be asking for too much help, but in that case, please tell me.

I've been looking at what you've wrote, and as I have no experience at all in NSIS scripting, I've looked into the tutorial section of the NSIS website to work it through.
However, I may have a few questions:

First, I added
code:
Outfile "myprogram.exe"
at the beginning
Then you introduce a local variable (flightsimroot), which you then define with strcpy function.

If I got it right, I could either enter a 'default path' instead of "c:\Program Files\Microsoft Games\Microsoft Flight Simulator X", or you mentioned another option that interests me!

Is it possible to find the flightsim root folder in the registry? And how?

I understood the rest of the script alright, except the
code:
File "pman_airbus.exe"
File "inidata.ini


What do you use these two functions for?

Finaly, my last question would be how to compile the script... Where do I 'put' my texture files and the pman_airbus.exe? How do I tell the compiler where these are?

Thanks again for your help, it's worth gold to me!

Edouard
edouardo17 is offline   Reply With Quote
Old 6th June 2014, 05:51   #8
edouardo17
Junior Member
 
Join Date: Jun 2014
Posts: 8
Hi fellows,

I eventually figured out most of the questions I asked above...
Tell me if I got anything wrong...

First I found out that the two lines:
code:
File "pman_airbus.exe"
File "livery.ini"


where just extracting the files to the outpath directory. Fairly easy...

Also, I now know how to compile the script, I figured out I had to put the files I wanted to be installed in the same folder as my script, otherwise the compiler wouldn't find it...

Then I looked this morning into the registry function to my disposal, and I found a few things.
First, here is a screenshot of where the registry is:


I'm now looking into a solution that could find the flightsim root folder for me, using the registries.
I have two ideas that could maybe work:

Quote:
Outfile "test.exe"
Var "flightsimroot"
InstallDirRegKey HKCU Software\Microsoft\Microsoft Games\Flight Simulator\10.0 "AppPath"

Section
SetOutPath "$INSTDIR\SimObject\Airplanes\feelThere PIC A333GE\texture.test"
File "pman_airbus.exe"
File "livery.ini"
ExecWait '"$OutPath\pman_airbus.exe"'
Delete "$OutPath\pman_airbus.exe"
Delete "$OutPath\livery.ini"
SectionEnd
OR (red=what has changed)

Quote:
Outfile "test.exe"
Var "flightsimroot"

Section
ReadRegStr $flightsimroot HKCU Software\Microsoft\Microsoft Games\Flight Simulator\10.0 "AppPath"
SetOutPath "$flightsimroot\SimObject\Airplanes\feelThere PIC A333GE\texture.test"

File "pman_airbus.exe"
File "livery.ini"
ExecWait '"$OutPath\pman_airbus.exe"'
Delete "$OutPath\pman_airbus.exe"
Delete "$OutPath\livery.ini"
SectionEnd
Which of those would be the best? And are they actually going to work?

Thanks in advance,
Edouard
edouardo17 is offline   Reply With Quote
Old 6th June 2014, 13:08   #9
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 878
I'm tempted to do something similar like this:
Quote:
Outfile "test.exe"
Var "flightsimroot"

Function .onInit
ReadRegStr $flightsimroot HKCU "Software\Microsoft\Microsoft Games\Flight Simulator\10.0" "AppPath"
IfErrors Error
; An error skips the following line which copies the dir to $OutPath
StrCpy $OutPath "$flightsimroot\SimObject\Airplanes\feelThere PIC A333GE"
GoTo End
Error:
MessageBox MB_OK|MB_ICONEXCLAMATION "Couldn't find Flight Simulator on your computer, is it installed?"
Quit
End:
FunctionEnd

Section
SetOutPath "$OutPath"
File "pman_airbus.exe"
File "livery.ini"
ExecWait '"$OutPath\pman_airbus.exe"'
Delete "$OutPath\pman_airbus.exe"
Delete "$OutPath\livery.ini"
SectionEnd
I don't see a declaration for $OutPath, so I take it this isn't the whole script?

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 6th June 2014, 13:58   #10
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,150
The UI part of your installer should probably use a directory page and .onVerifyInstDir


Quote:
Originally Posted by JasonFriday13 View Post
I don't see a declaration for $OutPath, so I take it this isn't the whole script?
That's a built-in NSIS variable...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th June 2014, 14:56   #11
edouardo17
Junior Member
 
Join Date: Jun 2014
Posts: 8
Hi everyone!!

The dream has come true!!!!
Yes indeed, thanks to all of you, I've eventually come up with a fully fonctional installer that does exactly what I asked!

Huge thank you to all of you!!

Bye,
Edouard
edouardo17 is offline   Reply With Quote
Old 10th June 2014, 17:34   #12
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 878
Quote:
Originally Posted by Anders View Post
The UI part of your installer should probably use a directory page and .onVerifyInstDir
Quote:
Originally Posted by JasonFriday13
I don't see a declaration for $OutPath, so I take it this isn't the whole script?
That's a built-in NSIS variable...
I didn't see it in the docs, I must be blind .

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump