Jump to content

A Couple of Questions That Aren't Really Related to LEGO (or Each Other For That Matter)


le717
 Share

Recommended Posts

I don't want this in a blog so everyone can read and give input on everyone else says, so I'm putting this here. ;)

Question 1: Does anyone know how to set up the GibHub for Windows client to work with Sourceforge? It says it can work with non-GitHub repos, but I can't figure it out.

Question 2: Where can I find out how to call (or reference) a Pascal Script function from withing Pascal Script? InnoSetup uses that for extenstion, and I have an installer I've been working on since April, and this lack of knowledge (and inability to find the info) is keeping me from finishing the installer.

That is all.

Link to comment
Share on other sites

JrMasterModelBuilder

Never use non-command line git, but maybe helpful?

http://sourceforge.net/apps/trac/sourceforge/wiki/Git

http://windows.github.com/

Eew, Pascal? Anyway, are you asking how to call a function in Pascal, or something more specific?

Link to comment
Share on other sites

Eew, Pascal? Anyway, are you asking how to call a function in Pascal, or something more specific?

The first one. I'll be more detailed later. Can't talk ATM. ;)

EDIT:


[CustomMessages]

; {cm:Line1} will not work in Pascal.

English.Line1=Installation Type:

English.Line2=How would you like to install OpenSong? OpenSong can installed to your computer or run portably from a USB device.

English.Line3= %n Please select which setting you prefer.'

English.Button1=Installed

English.Button2=Portable

Czech.Line1=Installation Type:

Czech.Line2=How would you like to install OpenSong? OpenSong can installed to your computer or run portably from a USB device.

Czech.Line3= %n Please select which setting you prefer.'

Czech.InstallButton=Installed

Czech.PortableButton=Portable


[code]

//I've cut a bunch of code out. If you need it, let me know. 

procedure InitializeWizard;

begin

  PortablePage := CreateInputOptionPage(wpLicense,

    'Line1()', '{#Line2}', //This must use the text defined in CustomMessages.

    '{#Line3}',    //As does this...

    True, False);

  PortablePage.Add('{#Line4}'); // and this...

  PortablePage.Add('{#Line5}'); // you get the point.

  PortablePage.Values[0] := True;

end;


function CustomMessage(const WelcomeLabel2: String): String;

var

  S: String;

begin

  S := CustomMessage('WelcomeLabel2'); //Pulled from the InnoSetup help. Just haven't changed it

  // S = 'Create a &desktop icon'

end;

Edited by le717
Link to comment
Share on other sites

Yea, I should have been more detailed in my post.

The code at the very bottom will be cloned 5 times, once for each line. It will refer back the a line in [CustomMessages]. The code in the middle needs to call (or refer to, whatever it's called) the coresponding pascal code at the bottom. The InnoSetup help says to use {cm:Line1} for custom messages, but it does not work in Pascal.

If you need to see the full code, look up Launcy.net, and get the 2.5 source code. It's under win.

Link to comment
Share on other sites

JrMasterModelBuilder

So the function CustomMessage returns a string that's supposed to be arguments 3 & 4 in CreateInputOptionPage(wpLicense, 'Line1()', '{#Line2}', '{#Line3}', True, False); ?

Link to comment
Share on other sites

This is the context in which I'm writing this script:

http://www.youtube.c...9D79A32FEF35103

This is the Pascal source code that I am using:

http://launchy.svn.s...aller/SETUP.iss

(Search for

"How should Launchy be installed?"

for the section I quoted above.)

That script (under the

 section) allows for the user to choose how they want Launchy to run: installer, or portabke via a .ini file. However, the text asking the user is hardcoded into it, in English.

The installer I am writing has to be multilingual, and the only way for me to achieve that is with the CustomMessages section. The InnoSetup docs says to use {cm:} to link back to a CustomMessages line, but that does not work in Pascal; it reads it literaly. The only way I can make it work is by adding the Pascal CM code, then making the Portable Switch code refer to that, and the Pascal CM code will refer back to the [CustomMessages] sections. It will work, but IDK how to reference a Pascal function in Pascal to make it work.

The Line1(), {#Line2}, etc. was debug code I was using, as well as an attempt to call a Pascal function (You'll see what I mean in the YT videos I linked above. ;))

Link to comment
Share on other sites

Well, the GitHub issues will be on hold for a while. The PC I had and was using and was planning on using for Git crashed (the same one I mentioned in my status updates), so I won't be able to do that for a while. However, I still need to figure out how to call (or reference) a Pascal function from within Pascal so I can finish the installer.

Link to comment
Share on other sites

JrMasterModelBuilder

It should be noted that I've never actually written any Pascal. Things said below may be blatently wrong.

For a function in Pascal to return a value you need to set a value to the name of the function like below:


function CustomMessage(const WelcomeLabel2: String): String;

begin

  CustomMessage := CustomMessage('WelcomeLabel2');

end;

Just creating a string varaible named s doesn't tell it to return. To pass what is returned as arguments to the function, I think you would need to set a string variable to a call to that function. Something like this:

procedure InitializeWizard;

var

  returnedValue: String

begin

  returnedValue := CustomMessage("the argument");

  PortablePage := CreateInputOptionPage(wpLicense, 'Line1()', returnedValue, returnedValue, True, False);

end;

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.