Discussion:
TSP Installation / Uninstallation from msi setup
(too old to reply)
Ravi Kansangara
2014-02-21 06:36:40 UTC
Permalink
Hello,

I am developing TSP for my PBX.

It has Main two files.
1. (.tsp) file
2. (.dll) file for TSP GUI

And few other files like Manual, Icons etc.

I am using Install Shield 6.3 Professional Version to Build setup for TSP Installation.

==========================================
During Installation
==========================================
i am,

1. copying both libraries (.tsp & .dll) to C:\WINDOWS\System32 folder.

2. load tapi32.dll & call lineAddProvider function to add my TSP automatically
to Phone & Modem Option.


Now Actual Problem is while uninstallation, that are

1. Install Shield Setup removes My Folder from C:\Program Files\[Manufacturer]
but it doesn't deletes (.tsp & .dll) files from System32 Folder.

2. Assume that i have added logic to forcefully delete (.tsp & .dll) files in
Install Shield Script, but What Happen if any TAPI Application is using
my TSP at the time of uninstall ? (i.e. When Any TAPI Application is running,
Deleting of TSP files give me Access Denied)

3. Should i forcefully Unregister my DLL & delete both files Or Should i stop
Telephony Service & delete both files ?

5. If I don't Delete that files, What to do When New Installation is done with
newer version of TSP ? (i.e. Without Deleting Old TSP file, How to Copy New
TSP File Or I should Stop Telephony Service before copying TSP files)

What should be Proper Sequence of TSP Installation & Uninstallation
with msi setup ?

Thank you.
Andreas Marschall [exMVP TAPI]
2014-02-21 22:39:04 UTC
Permalink
Post by Ravi Kansangara
Now Actual Problem is while uninstallation, that are
1. Install Shield Setup removes My Folder from C:\Program Files\[Manufacturer]
but it doesn't deletes (.tsp & .dll) files from System32 Folder.
2. Assume that i have added logic to forcefully delete (.tsp & .dll) files in
Install Shield Script, but What Happen if any TAPI Application is using
my TSP at the time of uninstall ? (i.e. When Any TAPI Application is running,
Deleting of TSP files give me Access Denied)
Ravi,
of course you cannot the TSP file while TAPISRV is running because the TSP is loaded by TAPISRV.

So you need to ensure that the Telephony Service is not running when removing the files, e.g. via "NET STOP TAPISRV".
Post by Ravi Kansangara
3. Should i forcefully Unregister my DLL & delete both files Or Should i stop
Telephony Service & delete both files ?
No! It is a very bad idea to remove the TSP file if TSP has not been removed properly from TAPI configuration!
This may lead to a non-functional Telephone Service on this machine because TAPISRV will keep on trying to load that TSP ever after!
You would need to repair the registry manually!

There are only two ways to properly remove a TSP:
1) by user action via Telephon.CPL
2) programmatically via lineRemoveProvider()
Post by Ravi Kansangara
5. If I don't Delete that files, What to do When New Installation is done with
newer version of TSP ? (i.e. Without Deleting Old TSP file, How to Copy New
TSP File Or I should Stop Telephony Service before copying TSP files)
I suggest comparing versions / fates of the files an replace older ones after stopping TAPISRV.
Post by Ravi Kansangara
What should be Proper Sequence of TSP Installation & Uninstallation
with msi setup ?
Install / Update:
- net stop tapisrv (if update)
- copy files (replace if update)
- lineAddProvider() (if not update)

Another update procedure would be: Uninstall followed by Install,
but this will assign a new dwPermanentProviderID what may cause some issues.

Uninstall:
- lineRemoveProvider()
- net stop tapisrv
- remove files

I guess you are aware that you need a x64-bit TSP on a x64 OS and a x86 TSP on a x86 OS, and need to copy the correct version for each OS type.
Please note that in both cases (x86 and x64) the correct destination directory is /system32/
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK / Visual C++ 2003-2008
TAPI / TSP Developer and Tester
My TAPI and TSPI FAQ:
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
My Toto® Tools (a collection of free, mostly TAPI related tools):
http://www.I-B-A-M.de/Andreas_Marschall's_Toto_Tools.htm
* Please post all messages and replies to the group / forum so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no rights.
Ravi Kansangara
2014-02-26 08:22:22 UTC
Permalink
Post by Andreas Marschall [exMVP TAPI]
Post by Ravi Kansangara
Now Actual Problem is while uninstallation, that are
1. Install Shield Setup removes My Folder from C:\Program Files\[Manufacturer]
but it doesn't deletes (.tsp & .dll) files from System32 Folder.
2. Assume that i have added logic to forcefully delete (.tsp & .dll) files in
Install Shield Script, but What Happen if any TAPI Application is using
my TSP at the time of uninstall ? (i.e. When Any TAPI Application is running,
Deleting of TSP files give me Access Denied)
Ravi,
of course you cannot the TSP file while TAPISRV is running because the TSP is loaded by TAPISRV.
So you need to ensure that the Telephony Service is not running when removing the files, e.g. via "NET STOP TAPISRV".
Post by Ravi Kansangara
3. Should i forcefully Unregister my DLL & delete both files Or Should i stop
Telephony Service & delete both files ?
No! It is a very bad idea to remove the TSP file if TSP has not been removed properly from TAPI configuration!
This may lead to a non-functional Telephone Service on this machine because TAPISRV will keep on trying to load that TSP ever after!
You would need to repair the registry manually!
What happens if i stop TAPI Service & any TAPI Applications are running ?
Or i should not bother about it?
Post by Andreas Marschall [exMVP TAPI]
1) by user action via Telephon.CPL
2) programmatically via lineRemoveProvider()
Post by Ravi Kansangara
5. If I don't Delete that files, What to do When New Installation is done with
newer version of TSP ? (i.e. Without Deleting Old TSP file, How to Copy New
TSP File Or I should Stop Telephony Service before copying TSP files)
I suggest comparing versions / fates of the files an replace older ones after stopping TAPISRV.
Post by Ravi Kansangara
What should be Proper Sequence of TSP Installation & Uninstallation
with msi setup ?
- net stop tapisrv (if update)
- copy files (replace if update)
- lineAddProvider() (if not update)
Another update procedure would be: Uninstall followed by Install,
but this will assign a new dwPermanentProviderID what may cause some issues.
- lineRemoveProvider()
- net stop tapisrv
- remove files
I guess you are aware that you need a x64-bit TSP on a x64 OS and a x86 TSP on a x86 OS, and need to copy the correct version for each OS type.
Please note that in both cases (x86 and x64) the correct destination directory is /system32/
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK / Visual C++ 2003-2008
TAPI / TSP Developer and Tester
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
http://www.I-B-A-M.de/Andreas_Marschall's_Toto_Tools.htm
* Please post all messages and replies to the group / forum so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no rights.
Thank you for reply, this really helped me.

I have 4 DLL's in my msi that are,

1. .tsp file (created by me)
2. .dll for tsp gui (created by me)
3. .dll for few helper function (created by me)
4. msvcr100d.dll (VC++ dependancy) (Copied from System32 Folder where Visual
Studio is installed)

Questions:

1. I have to put .tsp & .dll for tsp gui files to system32 folder. is that
correct ?

2. Where should i place Helper dll & msvcr100d.dll files ? In system32 or in
Installation folder. ( C:\\Program Files\\Manu...)

3. Is that necessary to Register my all files (.tsp, .dll for tsp gui & .dll for
helper functions) by providing "DllRegisterServer" & "DllUnregisterServer"
entries in the TSP & DLL Code ?

4. What Happens if i don't register my DLL's ?

Thanks.
Andreas Marschall [exMVP TAPI]
2014-02-27 02:31:56 UTC
Permalink
Post by Ravi Kansangara
What happens if i stop TAPI Service & any TAPI Applications are running ?
Or i should not bother about it?
Ravi,
running TAPI apps are notified by TAPISRV about Telephony Service shutting down and get qualified error message on subsequent usage attempts.
Here is a TB20.log where some lines are open while TAPSRV is being stopped, leading to a LINE_LINEDEVSTATE(LINEDEVSTATE_REINIT) message.
Afterwards there was a manual invoke of lineGetDevCaps() to demonstrate LINEERR_UNINITIALIZED.

22:25.29.882 : received LINE_LINEDEVSTATE
device=x0
cbInst=x0
param1=x40000, REINIT
param2=x0,
param3=x0,
22:25.43.819 : Calling lineGetDevCaps
22:25.44.832 : lineGetDevCaps returned LINEERR_UNINITIALIZED
Post by Ravi Kansangara
Thank you for reply, this really helped me.
You are welcome.
You may want to endorse & recommend / reference me at LinkedIn / Xing:
http://www.linkedin.com/in/andreasmarschall
http://www.xing.com/profile/Andreas_Marschall3
Thanks in advance.
Post by Ravi Kansangara
1. I have to put .tsp & .dll for tsp gui files to system32 folder. is that
correct ?
Yes.
Post by Ravi Kansangara
2. Where should i place Helper dll & msvcr100d.dll files ? In system32 or in
Installation folder. ( C:\\Program Files\\Manu...)
In my TSPs I have placed all required components all together at /system32/
Post by Ravi Kansangara
3. Is that necessary to Register my all files (.tsp, .dll for tsp gui & .dll for
helper functions) by providing "DllRegisterServer" & "DllUnregisterServer"
entries in the TSP & DLL Code ?
4. What Happens if i don't register my DLL's ?
A TSP only needs to implement and export the TSPI_ functions.
A TSP-UI only needs to implement and export the TUISPI_ functions.
The TSPI-UI-DLL name is queried by TAPISRV from the TSP by TSPI_providerUIIdentify().
That's it.
No need for other EXPORTS or registrations.
See atsp32 sample TSP from P-SDK.

The requirements for any additional / helper stuff depends on their architecture / technology (e.g. COM stuff etc.).
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK / Visual C++ 2003-2008
TAPI / TSP Developer and Tester
My TAPI and TSPI FAQ:
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
My Toto® Tools (a collection of free, mostly TAPI related tools):
http://www.I-B-A-M.de/Andreas_Marschall's_Toto_Tools.htm
* Please post all messages and replies to the group / forum so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no rights.
Ravi Kansangara
2014-02-28 05:21:25 UTC
Permalink
Post by Andreas Marschall [exMVP TAPI]
Post by Ravi Kansangara
What happens if i stop TAPI Service & any TAPI Applications are running ?
Or i should not bother about it?
Ravi,
running TAPI apps are notified by TAPISRV about Telephony Service shutting down and get qualified error message on subsequent usage attempts.
Here is a TB20.log where some lines are open while TAPSRV is being stopped, leading to a LINE_LINEDEVSTATE(LINEDEVSTATE_REINIT) message.
Afterwards there was a manual invoke of lineGetDevCaps() to demonstrate LINEERR_UNINITIALIZED.
22:25.29.882 : received LINE_LINEDEVSTATE
device=x0
cbInst=x0
param1=x40000, REINIT
param2=x0,
param3=x0,
22:25.43.819 : Calling lineGetDevCaps
22:25.44.832 : lineGetDevCaps returned LINEERR_UNINITIALIZED
Nice to know that.
Post by Andreas Marschall [exMVP TAPI]
Post by Ravi Kansangara
Thank you for reply, this really helped me.
You are welcome.
http://www.linkedin.com/in/andreasmarschall
http://www.xing.com/profile/Andreas_Marschall3
Thanks in advance.
Post by Ravi Kansangara
1. I have to put .tsp & .dll for tsp gui files to system32 folder. is that
correct ?
Yes.
Post by Ravi Kansangara
2. Where should i place Helper dll & msvcr100d.dll files ? In system32 or in
Installation folder. ( C:\\Program Files\\Manu...)
In my TSPs I have placed all required components all together at /system32/
Post by Ravi Kansangara
3. Is that necessary to Register my all files (.tsp, .dll for tsp gui & .dll for
helper functions) by providing "DllRegisterServer" & "DllUnregisterServer"
entries in the TSP & DLL Code ?
4. What Happens if i don't register my DLL's ?
A TSP only needs to implement and export the TSPI_ functions.
A TSP-UI only needs to implement and export the TUISPI_ functions.
The TSPI-UI-DLL name is queried by TAPISRV from the TSP by TSPI_providerUIIdentify().
That's it.
No need for other EXPORTS or registrations.
See atsp32 sample TSP from P-SDK.
The requirements for any additional / helper stuff depends on their architecture / technology (e.g. COM stuff etc.).
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK / Visual C++ 2003-2008
TAPI / TSP Developer and Tester
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
http://www.I-B-A-M.de/Andreas_Marschall's_Toto_Tools.htm
* Please post all messages and replies to the group / forum so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no rights.
Hi Andreas,

Thanks for reply.

I have done logic to start & stop tapisrv in Install Shield Script,
but i am facing one problem while stopping tapisrv that is,

When i call function
LaunchAppAndWait("c:\\WINDOWS\\System32\\net", "stop tapisrv", WAIT); from
Install shield script, above command is executed in new command prompt.

Still there no problem, but few other running services
(i.e. Remote Access Connection Manager, Remote Procedure Call (RPC))
are dependent on Telephony service.

So when "net stop tapisrv" command executes on installation/uninstallation, it prompts in cmd like..

-----------------------------------------------------------------------
The following services are dependent on the Telephony service.
Stopping the Telephony service will also stop these services.

Remote Access Connection Manager

Do you want to continue this operation? (Y/N) [N]:
-----------------------------------------------------------------------

User has to press "y" to stop the service, that i don't want.

So should i also stop "Remote Access Connection Manager" prior to "Telephony Service".

Are there any critical programs that can be affected if i stop above both services.
Loading...