Friday, December 18, 2015

PLL 4.5.x Reboot

Ok, got a bit of perspective and what I deludely call a stable base to work from.

1) I can compile what I am calling the 4.5.0 codebase.
- This includes the full suite of tools
- This includes the installer projects

* This will install on Windows 7 but crashes in the Player.
* Also needs two changes to the xmlConfig file to turn off the parallel port and set the refresh rate to 60.

Question.  Will this run on XP?

Virtual Machine time.  Nope. Corrupt installer.... some weird dll issue with the crap tools.

Back to the Wix installer... bah.

The next big job is trying to merge the branches to bring this compiling code up to date with the features set in the other branch without merging the unicode crap fest.

Thursday, December 17, 2015

Ghosts from the past

I have had cause to re-visit PointLightLab and I have to say that its a freakin mess.

Since I last worked on it in 2013 it has rusted pretty badly.  The versions in svn do not look right, the working directory on my hard drives are all out of whack and there was an abortive attempt to update the code to be Unicode compliant. What a mess.

I now have three different branches of the code:

The old version 4 Tag in the repo was stable when I put it in.

The version 5 branch was a never completed major upgrade.

The Unicode branch turned into a mess of epic proportions but seems to be based mostly on the version 4 codebase.

Somewhere in there is atleast two releases of partial toolsets to hack in various features for projects.

I really don't have time for this but its has fallen to me to try...

1) Get a stable code base?

Pulled the old v4 code from the repo and set it up.  Tried to compile it... needs to upgrade all the project files to VS2013.  Rejects the setup projects as expected.  Deja Vu.

2) Try compiling.  All the libraries are broken, old versions or not correctly set up in the environment variables. (This will probably bite me if I move back to the other code branch but WTF right now)

3) Update VS, libraries, tools, environment vars, project properties, third party compilers etc.  2 days later.... Found an extention that will handle the old setup project too... Awesome!  Much fiddling to get CodeSynthesis XSD working... but generally straight forward.


Insert stunned look here..... (Couple of link warnings that I have documented in the past but otherwise seems stable.)

BTW this is building win32 Debug Version against DX9 for Windows 7.  Have not tried the setup projects yet.

Swapped to the Windows XP toolchain and compiled each project.  One of the Unit Test projects is throwing a whole bunch of link errors.

Swapped to Release version and tried to build the project...

The HelpNDoc project is failing because the tool version has changed and I have not re-configured it yet.

PLLEditor is throwing a link error. WTF?
LINK : fatal error LNK1117: syntax error in option 'VERSION:4.3.0'
This is in the Linker > General > Version field.  I remember I used to have some version number in everything but its back a couple of versions of Visual Studio.  This may be a hangover from that. I have removed the number and its linking.

Link errors
1>  LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance
1>XMLFileLoaderBase.obj : warning LNK4248: unresolved typeref token (01000018) for 'xercesc_3_1.XMLGrammarPool'; image may not run
1>WaveFile.obj : warning LNK4248: unresolved typeref token (0100001E) for 'libSndFile.SNDFILE_tag'; image may not run

The linker throws the same two unresolved typedef errors as PLLPlayer and a flag error. /LTCG  which is link time code generation. No idea why that is set or changed from default. Set it back to inherit from solution settings and the flag error disapears.

I have previously solved the typedef errors by creating a stub typedef to shut the linker up.  Ignore for now.

The help file project is not working.  Its an old format with a configuration set up for VS2010 (I think).  Solution: Import the project from the other branch and patch it in.
No idea what the changes are at the moment.... This is generating a helpFile for v4.5.10. The rest of the project seems to be about v4.5.0.  This is not good.

Removed some trash from the project folder that was being generated by various tools or previous bad ideas.

Updated the versions of InpOut that are in the package.  for the 64bit version  for the older 32bit version

Updated the target .Net version in the setup package to .NET 4.0 full profile
Updated the target prerequisites to Windows Installer v4.5. 

This means I will need to update all the stand alone pcs that I am trying to install onto... fudge!

OK found how to set the Launch Conditions with this new editor.  Fixed the warning about mismatch between the .NET installer prerequ an the Launch Condition versions.  (Dragged it all up to .NET 4.0)  I don't think it will matter except to piss off users who are still running antique configurations of XP. (Probably me...)

Tuesday, September 24, 2013

Fix'n bugs Fix'n bugs...

1) Fixed - Not showing all pattern layers correctly in the debug view(F1).

Wednesday, March 20, 2013

WiX Installer from the Ground Up

I have poked at creating a WiX installer before, but I have to get it working now.

1) Update WiX Toolkit to v 3.8.309

2) Read the Manual....Conclusion... written by an idiot.

3) Read the tutorial....Conclusion... written by the same idiot.

Please not, I am not an XML noob. I've spent a lot of time building tricky schemas so its not the XML that's bothering me.  Simply the unstructured nature of the documentation.   And the version issues.

4) Start following along from the Sample to try to get a grasp on whats going on.  Still baffled.

5) Accidentally find a page in the docs called "How To Guides"  (  Score!

Making progress now.... Must be a decent editor for this kind of thing....ask the G man (Google to you lot)

6)  WiXTrim Looks interesting. Shows recent activity but crashes when I try to load my file into it.

WiX Edit  looks functional.  Basic but progress is much faster than simple hand editing.  Some version incompatability with some of the stuff from the WiX Toolkit docs.  Clean that crap out and use WiX Edit.

WiX Edit seems to be at Version 3.0.5419.0 of WiX
Not compatable with some features that I pulled out  of the current WiX docs:
  • MajorUpgrade Tag
  • MediaTemplate Tag
  • Files which include ShortCut Child Tags
Mmm... keep looking.

The following two are full suite's which will need some more detailed reviewing.

This freaks out the SmartScreen Filter in IE.  Its also bullshit.  Its nothing but a demo project jammed in Italian.  Ignore this project.

War Setup
This installer Toolkit is nice. It gets the job done for straight forward projects.  The documentation is good and well written.

OK. I'm calling it.  There are no other sourceforge projects worth mentioning.

Blog post here on WiX editors from the guy who seems to be up to his elbows in the WiX Toolkit development.  Covers most of the candidates that I have found.

Votive is the more interesting candidate. Seems to be part of the package but I can't find it on my machine.  Reading the docs that came with the package....


This is a four part article that seems fairly comprehensive.


Tuesday, March 19, 2013

Visual Studio 2012 Really Slow Performance

After having VS open and working for a couple of days it starts to run like a real pig. 

I can see icons flickering and intellisense is on its knees.  Closing a small file takes a minute or two now. It keeps spawning Tasks in Task Manager which show as not responding... then slowly killing them off. 

There is some serious thrash on its window refresh... I have displayFusion util to handle the multi-monitors and its overlay icon is thrashing so I can see when the repaint event are being called.

It also seems to be spawning svchost.exe processes and WmiPrvSE.exe processes. There are a bunch of other processes that seem to be hanging around and not doing much of anything.

Reboot'en time...


This situation has only gotten worse.

When I open the property page for a project its slow, but gets there... if I open the property page of the solution is shows a green "loading something" bar but never completes. (Its on the "Code Analysis Settings" item in the "Common Properties")  I can hear the disk thrashing like a million sick dragonflies.... so its probably paging something horrible through RAM and the cache. I need some solutions as its moved into the "non functional" category.  

Here are some other folks solutions

I will check the solutions systematically and see what happens.

 1) C:\Users\...\AppData\Local\Microsoft\WebSiteCache....My projects are not web projects.
But the crazy thing is that folders are being created in the WebSiteCache directory for each of my projects in the solution. WTF?

2) C:\Users\...\AppData\Local\Temp\Temporary ASP.NET Files\siteName.... not a web project
This folder is not being created on my machine.

3) Create a new project...mmm No. I would rather gouge out my own eyes with a plastic fork.  I have a decade of work in this project.

4) Network storage....mmmm No.  But possible...

5) Tools -> Options -> Debugging -> Edit & Continue  ....  Nope.  Did not do anything.

6) OPTIONS>ENVIRONMENT..under Visual Experience, untick “Use Hardware Graphics Acceleration If Available”  .... this is not an option in 2012... but there is something similiar. "Adjust Visual experience based on client Performance"... which when I untick that... after an initial freeze while I assume VS is cleaning itself up... the code editor is now nice and snappy.
The properties page is still choaking to death and there are nasty black borders around all the floating windows on my second monitor... can we say repaint error? Well more like a lockup.

Its doing its weird thing where it spawns lots of items in the "Applications" window and lots of  'svchost.exe' tasks...about 15 of them. (Althought I think they are spurious and not connected as they did not disapear when I ended up shutting down VS)

And now its back....

Even the property editor seems to be responsive now... whoot. Now I just have to remember what I was doing... Oh yeah editing the WIX deployment file.


After a full reboot.... it took the best part of 5 minutes for VS to open this time.  Not sure what I did but it seems to have really pissed it off.

I have now unticked the "Enable rich client visual experience" and "Use hardware graphics acceleration if availible"... just for fun as it can't really make the situation worse.

Lets see what happens now...

Quite quick. Lots of ugly refresh errors on the edges of windows and some controls... but it gets the job done. The property pages open quickly. (Still can't get to the Code Analysis Settings"...Will have a coffee break and see if its loaded by then)

Now on to Uninstalling add-ins

Uninstall VSCommands.... The whole UI is much faster to boot and seems responsive to editing.  The Property Page issue is still there.  (I might just call that a bug and leave it alone) Syntax highlighting is working again. Menus are still taking 3-4 seconds to pop up.

Uninstalled UML Design Patterns for Visual Studio.....Restarts faster.  Menus feel slightly faster.

Uninstalled the Colour Theme Editor....  No more theme.  Meuns are still 3-4 seconds to open.

Uninstalled C++ Debugger Visualisers .... kinda need this so this is just a test.

Uninstalled NuGet Package Manager... still slow menus.

I am down to "Microsoft Web Developer Tools", "Visual Studio Extensions for Windows Library for Javascript" and the "WIX Toolset".  None of which have an Uninstall option in the Extensions and Updates Manager. (Found the uninstall for the Javascript one in Control Panel > Porgrams and Features" also the Wix Toolkit)

I know I had "Visual Assist X" installed but its not showing up anywhere since I applied the VS Update 1.

I have turned off the "Source Control Plugin" option in the Tools > Options > Source Control.  Did not make any appreciable difference.  ( I was not using VS for Source Control anyway.  I use SVN manually)

For whatever reason in all these tweaks, the editor is now snappy and functional.  Menu's are still a couple of seconds to open.

I'm going to install Visual Assist X again to see if I can uninstall it cleanly.

Restart and Visual Assist X( VAX) is not parsing everything and doing all manner of overheads...
Still does not show up in the add-in manager. Ok, its in the Control Panel > Programs and Features.

Run the Uninstall... restart VS... and the Whole Tomato dialog pops up... WTF?  Tells me to use the Extension Manager... which it was not in when I looked 10min ago.

Looking... Ok... its appeared in the Extension Manager.... Uninstall again. Restart again.

Hmmm... editing is snappy. The menus are still slow but seem slightly faster.

Uninstall the Javascript Library now...took its sweet time... No obvious change.

Running out of ideas beyond throwing more RAM at the machine. 

Trolling the UserVoice forums is frustrating. 

Bug - Key repeating

Seems like all the key s are repeating faster than they did on the old machines ? Or I am not trapping it correctly because the program now drops right out rather than returning to the "go" screen.

Nope its key repeat. All they keys create a double keystroke.

Actually.... its the result of a quick hack I inserted for a student last year.... Doh.

The student needed to detect a key being pressed and later released to capture "periods" from the participant.  As it was a "quick fix".... I had not tested it extensivly.... tada! Bugs in 6 different files. 

All my sins come back to haunt me...

Bug - Stupid Random Number Generator rewrite

Using the new standard library C++0x random number generators is still an aquired taste.

Apparently if you initilise a bunch of random numbers together using the time clock, the value is truncated from a long long (__time64_t, time_t) down to an unsigned int....

I would assume that this involves dropping the MSB (most significant bits) but it seems not to.  So rather than using the bits with the highest entropy,  it uses the bits with the lowest and thus all the random number generators are seeded with the same value.... and generate the same sequence of numbers.  Doh.

The solution is the use the std::random_device to seed the generators and then go from there.  Sounds simple... and it apparently is .... but that did not stop the compiler throwing spurious errors yesterday afternoon on the same code that it happily compiles today.  Remind me why I do this again?

Anyway,  progress. 

Removed one cpp file, two headers and now have less dependancies on boost. (Not a bad thing, just trying to simplify)