Skip to main content

How to create a setup package for a Metro Application in Windows 8 using Visual Studio 2011

Odata cu Windows 8 si aplicatiile de tip Metro App, lucrurile au inceput sa se schimbe nu doar cum o aplicatie trebuie sa se comporte, sa arate si sa reactioneze ci si cum facem deploy-ul. Astazi vreau sa vorbim cum putem sa generam un pachet (setup package) pentru aplicatia noastra pentru a putea sa fie instalata m-ai tarziu pe o masina cu Windows 8. Necesitatea creari unui pachet apare destul de usor. Clientul ne poate cere intr-un anumit moment sa ii trimitem aplicatie pentru a vedea cum arata si cum functioneaza sau echipa de testare are nevoie de aplicatie pentru testare. Pentru oricare din aceste cazuri, un zip cu codul sursa nu este o solutie. Persoanele la care ajunge acest zip s-ar putea sa nu fie tehnice si nici nu vrei sa trimiti codul sursa la orice persoana. Output-ul generat in bin nu o sa ajute deloc. Microsoft ne ofera o solutie la aceasta problema - crearea unui pachet a aplicatiei noastre. Odata creat acesta poate sa fie instalat pe orice masina cu Windows 8. Dupa ce am creat aplicatia, este necesar sa selectam proiectul principal (cel pe care il folosim sa rulam aplicatia), iar din meniul care se afiseaza cand dam click dreapta pe acesta sa selecta "Store -> Create App Package" (la acesta optiune se poate ajunge si din meniu "Project -> Store -> Create App Package").
Dupa acest pas aveti doua optiuni, sa creati un pachet pentru store-ul de Windows 8 sau un pachet care sa fie folosit local. In cazul nostru, avem nevoie de a doua optiune. In acest moment este bine de mentionat ca acest pachet poate sa fie instalat doar pe sistemele de operare cu Windows 8 Enterprise sau cele care au o licenta pentru dezvoltare.

In urmatorul pas o sa fie necesar sa introducem locatie unde se v-a genera pachetul, versiunea aplicatiei si pentru ce platforme vrem sa cream pachetul (x86, x64, ARM, any CPU). La acest pas mi-a placut functionalitatea de auto-increment la versiunea aplicatiei. Ne poate salva de cateba batai de cap.
 Odata datele introduse pachetul se poate crea apasant butonul "Create", cand pachetul se genereaza automat. Pachetul odata generat o sa contina un fiser bat cu numele "Add-AppxDevPackage.bat" care poate sa fie rulat pe orice masina atat din linie de comanda cat si separat. Singurul lucru care trebuie facut la instalarea pachetului este sa rulam acest bat ca si administrator (cu drepturi elevate). Procesul de creare si deploy a unui pachet este destul de simplu, poate sa fie inclus si intr-un build automat a unui MSBUILD si este tot de ce am avea nevoie pentru un deploy simplu intr-un mediu de testare sau un demo pentru client.

Comments

  1. O aplicatie pentru care pana acum era sudicient XCopy-deployment, care ar fi motivul tehnic pentru care daca o rescriu pentru Metro/WinRT as avea nevoie de un installer cand o instalez direct local? Doar necesitatea de a face un deployment centralizat prin AD?

    ReplyDelete
    Replies
    1. O aplicatie Metro App, este special creata pentru tablete si dispozitive mobile. O tableta cu W8, nu o sa contina niciodata Windows Services sau aplicatii desktop clasice.
      Metro App o sa fie distribuite prin Store (asemanator cu Markerplace pentru WP7), iar instalarea acestora cu un kit de installer nu o sa poata sa fie facuta in general (exceptie Windows 8 Enterprise si vs de development).
      Deployment-ul asemanator cu cel cunoscut prin AD o sa poata sa fie facut doar in cazul in care exista Windows 8 Enterprise.
      Pentru aplicatiile desktop clasice, pe Windows 8 nu s-a schimbat nimica, dar acestea nu o sa ruleze pe tablete, unde varianta RT o sa fie instalata.

      Delete
    2. Stiu despre cele doua variante de deployment de la WinRT/Metro si de obligativitatea distributiei prin Marketplace - deci normal ca ma refeream la distributia in cadrul unui domeniu, care va fi o varianta foarte raspandita in cadrul firmelor care nu vor dori sa ca MS sa-si bage nasul in aplicatiile interne - pentru acest scenariu ar fi interesant mecanismul care ne va impiedeca fizic sa fac XCopy in locatia potrivita ;) daca am drepturi de admin pe statia locala cu Win8 (nu ma refer la tablete si mobile). Ca sunt ca si acuma avantaje la distributia centralizata prinAD, e alta poveste.

      Delete
    3. Ma tem ca motivatia pentru care in WinRT au reintrodus necesitatea unui installer se gaseste aici: http://www.winsupersite.com/blog/supersite-blog-39/windows8/windows-8-registry-140910
      - registry shows it's ugly head again, like in COM days.. :)
      Asta, si probabil faptul ca o aplicatie Metro in Win8 nu se va putea lansa din command-line, la fel ca pe Windows Phone, deci cumva va trebui adaugat un tile in start screen pentru a o lansa, in lipsa altei alternative.

      Delete

Post a Comment

Popular posts from this blog

Windows Docker Containers can make WIN32 API calls, use COM and ASP.NET WebForms

After the last post , I received two interesting questions related to Docker and Windows. People were interested if we do Win32 API calls from a Docker container and if there is support for COM. WIN32 Support To test calls to WIN32 API, let’s try to populate SYSTEM_INFO class. [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOemId; public uint dwPageSize; public uint lpMinimumApplicationAddress; public uint lpMaximumApplicationAddress; public uint dwActiveProcessorMask; public uint dwNumberOfProcessors; public uint dwProcessorType; public uint dwAllocationGranularity; public uint dwProcessorLevel; public uint dwProcessorRevision; } ... [DllImport("kernel32")] static extern void GetSystemInfo(ref SYSTEM_INFO pSI); ... SYSTEM_INFO pSI = new SYSTEM_INFO(

Azure AD and AWS Cognito side-by-side

In the last few weeks, I was involved in multiple opportunities on Microsoft Azure and Amazon, where we had to analyse AWS Cognito, Azure AD and other solutions that are available on the market. I decided to consolidate in one post all features and differences that I identified for both of them that we should need to take into account. Take into account that Azure AD is an identity and access management services well integrated with Microsoft stack. In comparison, AWS Cognito is just a user sign-up, sign-in and access control and nothing more. The focus is not on the main features, is more on small things that can make a difference when you want to decide where we want to store and manage our users.  This information might be useful in the future when we need to decide where we want to keep and manage our users.  Feature Azure AD (B2C, B2C) AWS Cognito Access token lifetime Default 1h – the value is configurable 1h – cannot be modified

What to do when you hit the throughput limits of Azure Storage (Blobs)

In this post we will talk about how we can detect when we hit a throughput limit of Azure Storage and what we can do in that moment. Context If we take a look on Scalability Targets of Azure Storage ( https://azure.microsoft.com/en-us/documentation/articles/storage-scalability-targets/ ) we will observe that the limits are prety high. But, based on our business logic we can end up at this limits. If you create a system that is hitted by a high number of device, you can hit easily the total number of requests rate that can be done on a Storage Account. This limits on Azure is 20.000 IOPS (entities or messages per second) where (and this is very important) the size of the request is 1KB. Normally, if you make a load tests where 20.000 clients will hit different blobs storages from the same Azure Storage Account, this limits can be reached. How we can detect this problem? From client, we can detect that this limits was reached based on the HTTP error code that is returned by HTTP