Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Determine if an application is registered from a batch file
masseyf
#1 Posted : Thursday, June 7, 2012 6:09:07 PM(UTC)
Groups: Member
Joined: 10/28/2011(UTC)
Posts: 12
Location: Montreal

Was thanked: 3 time(s) in 3 post(s)
Hi,

Got another question related to installing/uninstalling from a batch. Is it possible to verify if an application is registered? It would be mighty convenient to be able to. For example, UWS.RegApp.exe -isregistered -appid:{B5E73E8D-A76C-42F2-AFBB-3C528CC739D3} would return zero if registered or 1 if not. Maybe there is something already but couldn't find it...


Thanks!
Ultidev Team
#2 Posted : Thursday, June 7, 2012 11:16:29 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

There is no way to check, but we hope is alright because there is no downside in re-registering an application that is already registered. If registration is that same as before, it's not disruptive and not going to change anything.

Could you please let us know why do you think the check would be helpful?

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#3 Posted : Friday, June 8, 2012 8:40:26 AM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278


Hi,

As you guessed, I would like to *not* re-register an application that is already registered or try to unregister an application that is not registered. It may not have implications Cassini-side but it may disrupt users already logged in, for example, if an application is re-registered needlessly. Anyway it just seems ineffective and it isn't clear what happens in those cases. It would be good practice to not do something that's already done.
Ultidev Team
#4 Posted : Friday, June 8, 2012 10:19:38 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hello,

We would be happy to clarify what happens when applications are registered and unregistered. Re-registering an application does not disrupt users in most cases: sessions are kept as host processes stay loaded. The first request sent to an application that has been re-registered will be slow, but should not kick users out. We consider this to be a pretty small price to pay for the simplicity of the command-line registration, where multiple registrations and unregistration have small effect. When application is unregistered, some of its settings are stored for later, and in case the application is registered again, previous ports can be used if they
are still available. Registering an application that is already registered does not fail - it replaces previous registration. Unregistering non-existing application does not produce failures either.

The solution that you may want to consider is using UWS configuration API. It can be used from .NET and COM, and has methods that let you examine whether the application is installed, and then use one of the RegisterApplication() overloads to register it.

Please let us know if we you have questions.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
masseyf
#5 Posted : Thursday, June 14, 2012 7:09:09 AM(UTC)
Groups: Member
Joined: 10/28/2011(UTC)
Posts: 12
Location: Montreal

Was thanked: 3 time(s) in 3 post(s)
Hi,

Sorry for the delay.

I haven't really looked into the API and maybe I should. But one issue I have and the reason I use batch files is that our apps may be installed on 32 or 64 bit systems, XP or Vista/win7, which changes the location of the installation and the ports that can be used, etc. I install different flavor of the same batch files depending on the bitness and the flavor of the system the app is being installed on. The issue is further compounded by the auto-update utility we use which is not aware of the OS either. If I were to write tools to access the API I assume I would have to write my own logic to determine the system properties which I don't want to do because of time and resource constraints. I let InstallShield do that for me. In that respect, adding options to your command line tool makes sense. Why re-invent the wheel?

Anyway, it is not a show stopper in any way. I'm just arguing my case!
Ultidev Team
#6 Posted : Thursday, June 14, 2012 1:45:06 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi!

When your installer/updater upgrade your app code base, application will be reloaded by ASP.NET, causing brief downtime event if re-registration is not involved. Roughly same delay is introduced by re-registering an existing application. If in some cases your installer does not change application files, then same logic should prevent UWS application registration from happening. Are we missing anything here: it looks to us that if you upgrade files, you have go through short downtime and re-registering won't hurt, and if you don't change file, then don't re-register either.

Even when using UWS config API, you probably won't have to do much of manual work of figuring out system configuration - you could use InstallShield custom actions, which can pass parameters to your code with target folder, etc.

Finally, when you re-register a previously-registered application, and you specified port 0 (system assigned) among endpoints, UWS will register it on the same port as before, so you won't need to first check which port its on and then re-register - it's done automatically. That's why we suggest so loudly to always use system-assigned port on at least one application endpoint.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.