Squirrel / Squirrel.Windows

An installation and update framework for Windows desktop apps
MIT License
7.42k stars 1.03k forks source link

Using UpdateManager with Azure blob storage #1324

Closed SeeUnsharp closed 6 years ago

SeeUnsharp commented 6 years ago

Hi I am struggling a bit with updating my app based on Azure blob storage with an SAS URL. I push my release files directly from VSTS to my blob container.

My URL looks like this: https://****.blob.core.windows.net/suris-releases?TOKEN&comp=list&restype=container

which gives me this XML page:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<EnumerationResults ServiceEndpoint="https://****.blob.core.windows.net/" ContainerName="CONTAINERNAME">
<Blobs>
<Blob>
<Name>RELEASES</Name>
<Properties>
<Last-Modified>Mon, 28 May 2018 14:21:48 GMT</Last-Modified>
<Etag>0x8D5C4A6592908BE</Etag>
<Content-Length>75</Content-Length>
<Content-Type>application/octet-stream</Content-Type>
<Content-Encoding/>
<Content-Language/>
<Content-MD5>****</Content-MD5>
<Cache-Control/>
<Content-Disposition/>
<BlobType>BlockBlob</BlobType>
<AccessTier>Hot</AccessTier>
<AccessTierInferred>true</AccessTierInferred>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<ServerEncrypted>true</ServerEncrypted>
</Properties>
</Blob>
<Blob>
<Name>Setup.exe</Name>
<Properties>
<Last-Modified>Mon, 28 May 2018 14:21:49 GMT</Last-Modified>
<Etag>0x8D5C4A65A1C6BB8</Etag>
<Content-Length>69489664</Content-Length>
<Content-Type>application/octet-stream</Content-Type>
<Content-Encoding/>
<Content-Language/>
<Content-MD5>****</Content-MD5>
<Cache-Control/>
<Content-Disposition/>
<BlobType>BlockBlob</BlobType>
<AccessTier>Hot</AccessTier>
<AccessTierInferred>true</AccessTierInferred>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<ServerEncrypted>true</ServerEncrypted>
</Properties>
</Blob>
<Blob>
<Name>Setup.msi</Name>
<Properties>
<Last-Modified>Mon, 28 May 2018 14:21:49 GMT</Last-Modified>
<Etag>0x8D5C4A65A1FC748</Etag>
<Content-Length>69521408</Content-Length>
<Content-Type>application/octet-stream</Content-Type>
<Content-Encoding/>
<Content-Language/>
<Content-MD5>****</Content-MD5>
<Cache-Control/>
<Content-Disposition/>
<BlobType>BlockBlob</BlobType>
<AccessTier>Hot</AccessTier>
<AccessTierInferred>true</AccessTierInferred>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<ServerEncrypted>true</ServerEncrypted>
</Properties>
</Blob>
<Blob>
<Name>Suris-0.1.0-full.nupkg</Name>
<Properties>
<Last-Modified>Mon, 28 May 2018 14:21:49 GMT</Last-Modified>
<Etag>0x8D5C4A65A1FC748</Etag>
<Content-Length>68915371</Content-Length>
<Content-Type>application/octet-stream</Content-Type>
<Content-Encoding/>
<Content-Language/>
<Content-MD5>****</Content-MD5>
<Cache-Control/>
<Content-Disposition/>
<BlobType>BlockBlob</BlobType>
<AccessTier>Hot</AccessTier>
<AccessTierInferred>true</AccessTierInferred>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<ServerEncrypted>true</ServerEncrypted>
</Properties>
</Blob>
</Blobs>
<NextMarker/>
</EnumerationResults>

I guess this is not a compatible URL for UpdateManager right? Could anybody help me how I can use this blob storage with Squirrel?

Thanks!

SeeUnsharp commented 6 years ago

Small update... phewww.

I created a Azure Data Factory Task which copies the release blobs to my file storage folder. Then I created a function app which looks every 3 minutes for blob changes and fires the data factory trigger when there are new or updated blobs. Now i can access the Azure File Share like a network share. Pretty big workflow just to access some files :)

anaisbetts commented 6 years ago

I recommend using S3 I guess? This part of Azure sounds like a tire fire

SEAHood commented 6 years ago

I'm having this exact issue, we're storing all of the nupkg files and RELEASES file in blob storage in Azure - to access them we have to use a SAS token to avoid unauthorised access.

It seems as though squirrel can check for updates fine but when downloading the file, it strips off the query string. Is there any way around this?

Relevant logs:

2018-10-10 16:10:15> FileDownloader: Downloading url: https://<blob container url>/RELEASES?<redacted token query string>&localVersion=0.0.10&arch=amd64 2018-10-10 16:10:15> FileDownloader: Downloading file: https://<blob container url>/program-0.0.11-full.nupkg

kalpeshah commented 5 years ago

hi @SEAHood

Did you find any solution to this problem ?

I am struggling with it as well.

Thanks

-Kalpesh

SEAHood commented 5 years ago

hi @SEAHood

Did you find any solution to this problem ?

I am struggling with it as well.

Thanks

-Kalpesh

Unfortunately not Kalpesh, we used an anonymous access link for the files for a while but in the end we scrapped the project. It's been a while though so there may now be a solution, but not to my knowledge! Best of luck Sam

kalpeshah commented 5 years ago

Thanks Sam.

Vaagha Consultancy Limited 37, Office On The Hill, Stanmore Hill, Stanmore, HA7 3DS

Phone : +44-7743391227 Email : kalpesh.shah@vaagha.commailto:kalpesh.shah@vaagha.com Web : www.vaagha.comhttp://www.vaagha.com/

From: Sam notifications@github.com Sent: 05 September 2019 08:40 To: Squirrel/Squirrel.Windows Squirrel.Windows@noreply.github.com Cc: Kalpesh Shah - Vaagha kalpesh.shah@vaagha.com; Comment comment@noreply.github.com Subject: Re: [Squirrel/Squirrel.Windows] Using UpdateManager with Azure blob storage (#1324)

hi @SEAHoodhttps://github.com/SEAHood

Did you find any solution to this problem ?

I am struggling with it as well.

Thanks

-Kalpesh

Unfortunately not Kalpesh, we used an anonymous access link for the files for a while but in the end we scrapped the project. It's been a while though so there may now be a solution, but not to my knowledge! Best of luck Sam

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Squirrel/Squirrel.Windows/issues/1324?email_source=notifications&email_token=ACXG2UO7XEB34SVSYNSJTUDQICZV3A5CNFSM4FCEBGS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD56FCLY#issuecomment-528240943, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACXG2UJVDID2WTK3BZBYZCTQICZV3ANCNFSM4FCEBGSQ.

ragbn commented 4 years ago

You can construct webclient object with blob querystring namevalue pairs and pass it to updatemanager with url.

        var client = new WebClient();
        NameValueCollection col = new NameValueCollection();
        col.Add("sv","2019-10-10");
        col.Add("ss","xx");
        col.Add("srt","xxx");
        col.Add("sp","xxx");
        col.Add("se","xxx");
        col.Add("st","xxx");
        col.Add("spr","xxx");
        col.Add("sig","xxxxx");
        client.QueryString = col;
        var fileDownloader = new Squirrel.FileDownloader(client);
       using (var manager = new UpdateManager("https://blobname.blob.core.windows.net/container?yoursastoken", urlDownloader: fileDownloader);
frederikolsen88 commented 4 years ago

Thank you, @ragbn! I can confirm that the above approach works.