Create Sparkle Appcast File.app produces invalid download url in the XML

In the enclosure tag the url attribute has an URL which begins with https:/ instead of https://. Maybe the script is only prepared for non-secure http-URLs.

It would also be great to have this feature included into SD Notary, so it can generate appcast files.

Thanks for posting this. I had been meaning to post something about this but never got around to it. I’ve found the exact same issue and have wanted to find a way to fix this but in the meantime I just manually edit the xml by hand each time like an animal.

It’s been a while since I looked deeply into this but from what I can remember/tell from the brief look I just took now is that the error seems to be on the line that says:

	set appcastZipLink to appcastDir's stringByAppendingPathComponent:"downloads"

I’ve modified the script/applet that Shane provides, and the above line is from my modified code. I haven’t yet gone back to check where the error occurs in the original code.

But here’s an extract that I used to test where the error was creeping in.

-- just use the original code up to this point
	set appcastLink to theNSDictionary's objectForKey:"SUFeedURL"
	if appcastLink = missing value then error "The application does not have an entry for SUFeedURL in its Info.plist file."

	set appcastName to appcastLink's lastPathComponent()
	set theText to appcastLink's substringToIndex:((appcastLink's |length|()) - (appcastName's |length|()))

	-- the following line removes the /
	set appcastZipLink to theText's stringByAppendingPathComponent:"downloads"

	-- set appcastZipLink to appcastZipLink's stringByAppendingPathComponent:(appName's stringByAddingPercentEncodingWithAllowedCharacters:(NSCharacterSet's URLQueryAllowedCharacterSet()))

	set theText to "theText is " & (theText as text) & return & "appcastZIPLink is " & (appcastZipLink as text)
	set theText to (appName as text) & space & (shortVersion as text)

	set theText to NSString's stringWithString:theText
	using terms from scripting additions
		display dialog (theText as text)
	end using terms from

Late thanks for your investigations. It didn’t work for me, but you’ve found the right line. I just replaced stringByAppendingPathComponent with stringByAppendingString in the original code, and it works for me. Maybe stringByAppendingPathComponent is wrong as it is designed for file paths and not URLs.

I had the same issues and edited the line:

theEnclosure's setAttributesWithDictionary:{URL:appcastZipLink, |sparkle:version|:buildVersion, |sparkle:shortVersionString|:shortVersion, |length|:sizeString, |type|:"application/octet-stream", |sparkle:dsaSignature|:theSignature}

to

theEnclosure's setAttributesWithDictionary:{|URL|:appcastZipLink, |sparkle:version|:buildVersion, |sparkle:shortVersionString|:shortVersion, |length|:sizeString, |type|:"application/octet-stream", |sparkle:dsaSignature|:theSignature}

I had posted an update to Sparkle Appcast <Enclosure Line changed?

Seems like either works!

I also addes pipes around URL, but to fix the missing url in the XML file. I still have to do my posted fix.

1 Like