Author Topic: WiX: data in %AppData% are to appear in time  (Read 2573 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
WiX: data in %AppData% are to appear in time
« on: June 15, 2016, 08:20:58 AM »
WiX project.

I write the installer for AutoCAD plugin. It creates menu in the Start -> All Programs -> etc:



Also, my installer creates the set of %AppData% subfolders and copies into them some set of configurable files and DLL. These files will be used by my plugin when it will be loaded into AutoCAD. I.e. these files are to be existing when my plugin is loading into AutoCAD.



Now I switch to other Windows user profile. I see my menu, but I don't see my data in the %AppData%. If I open my documentation or license file through one of my shortcuts of the Program Menu, then my data appeares in the %AppData% folder at once. Good. Pay attention that it will happen only if I use shortcut instead of their target files directly.

Ok, but it is possible what user will load my plugin without opening of my documentation or license file before... At this case the data which are necessary for my plugin working will be absent still... I had a hope what when AutoCAD will load my plugin then its data will appear in the %AppData% like this was happening when I used Program Menu. But I was mistaken and my data didn't appear in the %AppData% at this case.

So, I need either my data will appear in %AppData% when user login in Windows, or just before AutoCAD will load my plugin. Or maybe it is possible in my plugin code through C# to force Windows OS to install the components which are not installed still in the %AppData%

How can I solve it?
« Last Edit: June 15, 2016, 10:42:51 AM by Andrey Bushman »

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: WiX: data in %AppData% are to appear in time
« Reply #1 on: June 15, 2016, 01:56:46 PM »
For solving of this problem I decided to exclude the %AppData% filling operation from the MSI-package. I'll do it like I did it always before: in my plugin's code through the Initialize() method. 

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: WiX: data in %AppData% are to appear in time
« Reply #2 on: June 16, 2016, 07:01:45 PM »
Did you try installing into the Default User's AppData? (In Windows 7: C:\Users\Default) In your original installation it would only be installed in the %appdata% of the currently logged-in user. who installed it.

The advantage of putting things in %appdata% is that folder is writable for users who have no admin rights. Program Files etc are not writable by these users. See also if there is a Wix setting for installing %Appdata% for all users, as opposed to just the current user. I don't know if there is.

I now test my installations on a VM with very limited user rights and NO Windows Updates. A lot of business run seem their systems like this, I think because their IT departments are a pack of lazy retards who are just clever enough to out-bluff the management who are about as tech-savvy as your average Fox News presenter.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: WiX: data in %AppData% are to appear in time
« Reply #3 on: June 17, 2016, 05:52:05 AM »
In your original installation it would only be installed in the %appdata% of the currently logged-in user. who installed it.
Now I switch to other Windows user profile. I see my menu, but I don't see my data in the %AppData%. If I open my documentation or license file through one of my shortcuts of the Program Menu, then my data appeares in the %AppData% folder at once. Good. Pay attention that it will happen only if I use shortcut instead of their target files directly.
This behaviour seems like the demand installing for other users. But I didn't set for each my shortcut 'Advertise' attribute 'yes' value...
The advantage of putting things in %appdata% is that folder is writable for users who have no admin rights. Program Files etc are not writable by these users.
I know it.
Did you try installing into the Default User's AppData?
No. Each user are to have the own copy of CUI, CUIX, and MNR files because he can edit them like he need and these changes aren't to be applied to the preferences in the settings of other users. The BUNDLE-manager appeared since AutoCAD 2013, but I compile my extensions for AutoCAD 2009 and newer. I.e. AutoCAD 2009-2012 haven't the BUNDLE-manager. Old AutoCAD versions didn't copy the menu files into the user profile.

So, users get the problems for old AutoCAD versions when menu files was located in the read-only directory if this directory hasn't MNR file (for that CUI\CUIX), or if user want to edit menu.

It is important to consider a possibility of installation of the application in the directory which will be available only for reading to users. Therefore for old AutoCAD versions I create the copy of CUI and CUIX files in the profile of each user which uses AutoCAD.
« Last Edit: June 17, 2016, 06:00:10 AM by Andrey Bushman »