Bug 5758 - All SeamlessRDP files disappear from server after upgrade
Summary: All SeamlessRDP files disappear from server after upgrade
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: | WTS Tools (deprecated) (show other bugs)
Version: 4.5.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.6.0
Assignee: Karl Mikaelsson
URL:
Keywords: ossman_tester, relnotes
Depends on:
Blocks:
 
Reported: 2015-12-18 11:27 CET by Karl Mikaelsson
Modified: 2016-04-12 12:26 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Karl Mikaelsson cendio 2015-12-18 11:27:33 CET
Server: Windows 2012R2.
WTS-Tools: ~ 4.5.0post-4976

I've reproduced this two times now - first by accident and later intentional.

If SeamlessRDP is not in use, everything seems to be present after reboot. 

If SeamlessRDP is being used, updating WTS Tools will result in SeamlessRDP files missing after reboot, (as the installer tells us to do). The files (plus the temp files) were present before the reboot.
Comment 1 Karl Mikaelsson cendio 2016-02-22 14:39:02 CET
We're having a hard time reproducing this now. The only way we've managed so far is to install wts-tools a second time before rebooting.

NSIS seems to use the MoveFileEx Windows API, which handles moving files on reboot. The file renames are present in a registry entry, in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
Comment 2 Karl Mikaelsson cendio 2016-02-22 15:42:43 CET
(In reply to comment #1)

The way we install files is by a helper macro in NSIS that installs /file/ to /file.tmp/, deletes /file/ on disk, and finally renames /file.tmp/ to /file/. The latter two operations are combined with a /REBOOTOK flag, meaning that if there is an error deleting and/or renaming the file, it will be done on next reboot.

Installing tl-wts-tools twice when, for example, seamlessrdp32.dll is being used will lead to the following operations being scheduled after next reboot:

 1. delete seamlessrdp32.dll
 2. rename seamlessrdp32.dll.tmp to seamlessrdp32.dll
 3. delete seamlessrdp32.dll
 4. rename seamlessrdp32.dll.tmp to seamlessrdp32.dll

Here, step four will fail because the tmp file has already been erased by step two, leading to the scenario described in the description.

A way around this problem would be to start generate and use a unique temporary file name for each file to be installed.
Comment 5 Pierre Ossman cendio 2016-03-02 13:06:52 CET
Works fine. Tested double installation with a locked file for:

 - wts tools
 - ThinLinc client
 - Custom installer built by customizer

In all three cases I saw a whole bunch of temp files, and after reboot it was only the proper files left with nothing missing.

Tested on 2012R2.

Note You need to log in before you can comment on or make changes to this bug.