1

I am trying to fire a S2S pixel from the installer when an install is successful. The pixel require some details like the IP, location, time and sub-id.

I got all the details except the sub id, which is specified on the command line using /subID=xxxx switch, when executing the installer.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • What is "sub id"? – Martin Prikryl Sep 29 '16 at 11:29
  • The Sub id is used to Identify which publisher sent the install for example if there are 10 publisher each will be using a different sub id which will be something /subID=xxxxx they will be using this in the Command line now i need to capture what sub id used in the time of installation and send them back to the server using a pixel tracking. –  Sep 29 '16 at 11:37

1 Answers1

1

You can use the {param:ParamName} pseudo-constant.

See also Is it possible to accept custom command line parameters with Inno Setup.

In a Pascal Script you can resolve it using the ExpandConstant function:

ExpandConstant('{param:subID}')

If you need some custom parsing, you will have to parse the command-line explicitly by iterating the parameter list using the ParamStr and ParamCount function.

See some of the answers in the question linked above, and also:

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • (http://pastebin.com/0GRpVKx2) this is what i have posted the codes in the question can you please help me edit that it works as i wanted. because the place you have mentioned i have something else to work also am afraid if i do anything wrong i might loose what i have now that is why. :-( –  Sep 29 '16 at 11:51
  • I do not understand, what you ask me for. Just use the `ExpandConstant('{param:subID}')`, the same way, you for example use the `trim('{#MyAppName}')`. – Martin Prikryl Sep 29 '16 at 11:52
  • In which part of the code i have to make the above changes and this is what i have in the NewInstallerPath:=ExpandConstant('{tmp}\Setup.exe'); –  Sep 29 '16 at 11:56
  • Also please do not take it wrong if my questions are not perfect because am learning very slowly. –  Sep 29 '16 at 11:58
  • What does `NewInstallerPath` has to do with your question? You download the actual installer right? So you want to propagate the `/subid` switch value from the main installer to the subinstaller? Or what? – Martin Prikryl Sep 29 '16 at 12:29
  • Not exactly, The code i have pasted is to the installer i have compiled the code and got it as a executable after that i will give it to 10 publishers each one will be using their own installer with a command line like this ( /Verysilent /Subid=xxxxxx) now i have to capture what subid they have used in their installer to executive my compiled executable and send it to the server via S2S pixel exactly where it says campaign. –  Sep 29 '16 at 12:44
  • So again, what does `NewInstallerPath` has to do with your question? – Martin Prikryl Sep 29 '16 at 12:53
  • that is what i have in my code the guy who did the code is not with me anymore so that is the am trying to figure out to be honest i dont know for what it is used for. :-( –  Sep 29 '16 at 12:58
  • Well, then again, take a look at the `app := trim('{#MyAppName}');`. Introduce a new variable `SUBID`, like the `app`. And assign it the `ExpandConstant('{param:subID}')`. You already use the `SUBID`, when generating the URL. – Martin Prikryl Sep 29 '16 at 13:08
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/124544/discussion-between-baskar-kumar-and-martin-prikryl). –  Sep 29 '16 at 13:19
  • Well i have tried the same but its posting the Sub id instead posting an empty value Result : http://imgur.com/a/4PO3n –  Sep 29 '16 at 13:57
  • This is the new Code http://pastebin.com/KKLRDw0d also please see the images attached here ( http://imgur.com/a/4PO3n ) you can see what am trying to do –  Sep 29 '16 at 14:06
  • 1
    You never assign the `SUBID` variable! `SUBID := ExpandConstant('{param:subID}');` – Martin Prikryl Sep 29 '16 at 14:39
  • Can you please tell me how i can do that –  Sep 29 '16 at 14:43
  • You are Great as always thank you so much. you are the master blaster –  Sep 29 '16 at 14:46