Unable to obtain command headers.

Got a problem you cannot solve? Try here.
SebSpiers
Posts: 38
Joined: Tue Dec 20, 2016 7:14 am
Location: Tewkesbury, UK

Unable to obtain command headers.

Postby SebSpiers » Wed Dec 28, 2016 11:15 am

Hi Guys,

So I've got an issue with the Create Shortcut function, it seems to be throwing up a runtime error.

"Unable to obtain command headers. Please rebuild your project."

My question simply is, what are command headers? and how do I resolve this issue? :)

The Create Shortcut I'm trying to do is very simple:

Code: Select all

Create Shortcut C:\Users\Public\Desktop\Software Name to C:\Program Files (x86)\Software Vendor\Software Name\Software.exe, Pin to Start Menu


Any ideas?
I'm not a developer, I just want to install things...

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Unable to obtain command headers.

Postby FrancescoT » Wed Dec 28, 2016 12:59 pm

Dear SebSpiers,

for what I see your Create Shortcut statement is not correct.
I suggest you to have a look at the "Shortcuts sample" from;
https://www.installaware.com/forums/viewtopic.php?f=2&t=6772

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

SebSpiers
Posts: 38
Joined: Tue Dec 20, 2016 7:14 am
Location: Tewkesbury, UK

Re: Unable to obtain command headers.

Postby SebSpiers » Wed Jan 04, 2017 8:48 am

FrancescoT wrote:for what I see your Create Shortcut statement is not correct.
I suggest you to have a look at the "Shortcuts sample" from;
https://www.installaware.com/forums/viewtopic.php?f=2&t=6772

Looking at the example the only differences that I can see are that:

1. I'm not trying to Run as Administrator
2. I am manually specifying the location in which I would like the shortcut placed

This should work, no?
I'm not a developer, I just want to install things...

SebSpiers
Posts: 38
Joined: Tue Dec 20, 2016 7:14 am
Location: Tewkesbury, UK

Re: Unable to obtain command headers.

Postby SebSpiers » Wed Jan 04, 2017 9:53 am

I have reviewed the documentation here: https://www.installaware.com/FlashHelp/ ... ortcut.htm

I am only specifying values for:

1. Shortcut to File - which I can confirm is correct, I can launch the application using the value in the Run dialog box.
2. Link Name - this is just a text value, so should not have any impact at all?
3. Link Location - This is set to "C:\Users\Public\Desktop" - which is for all users.

Windows Size set to Normal.
Everything else is unchecked and/or empty.

Any thoughts?
I'm not a developer, I just want to install things...

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Unable to obtain command headers.

Postby FrancescoT » Wed Jan 04, 2017 12:10 pm

Dear SebSpiers,

for sure there is an error somewhere with the approach you used...however, without having your exact code it's quite difficult to say where this could be.

As I said previously, I suggest you to replicate in your code how the shortcut gets created by the sample. Of course, you don't need to specify any "Run as Administrator" option.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

SebSpiers
Posts: 38
Joined: Tue Dec 20, 2016 7:14 am
Location: Tewkesbury, UK

Re: Unable to obtain command headers.

Postby SebSpiers » Thu Jan 05, 2017 7:20 am

I solved this using a compressed vbs script to create the shortcut.

vbscript (mkshortcut.vbs)

Code: Select all

set WshShell = WScript.CreateObject("WScript.Shell" )
set oShellLink = WshShell.CreateShortcut(Wscript.Arguments.Named("shortcut") & ".lnk")
oShellLink.TargetPath = Wscript.Arguments.Named("target")
oShellLink.WindowStyle = 1
oShellLink.Save


Used like this:

Code: Select all

Extract 7Zip Archive $SUPPORTDIR$\mkshortcut.zip into folder C:\TempRun Program C:\Temp\mkshortcut.vbs /target:"C:\Program Files (x86)\XXXXXXXXXXX\XXXXXXXXXXX.exe" /shortcut:"XXXXXXXXXXX" (WAIT)
Run Program cmd /c copy "C:\Temp\XXXXXXXXXXX.lnk" "C:\Users\Public\Desktop" /y (WAIT)
Last edited by SebSpiers on Thu Jan 05, 2017 7:21 am, edited 1 time in total.
I'm not a developer, I just want to install things...


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 59 guests