Registry not set using Visual Studio 2017 Installer Project - visual-studio-2017

I create a visual studio installer project on visual studio 2017 for word add-in.
The registry is not set when installing it. What do I do wrong during the process?
I have a MyWordAddIn solution which when running through visual studio correctly open Word 2016 and launch the add-in. I went to the HKEY_CURRENT_USER/SOFTWARE/Microsoft/Office/Word/Addins/ and find the myAddIn folder which has been created by visual studio during the debug run.
I now no that I must add 3 string value :
Manifest : file:///[the local directory]/MyWordAddIn.vsto|vstolocal
Description : "MyWordAddInName"
FriendlyName : "My word Add-In name"
and 1 binary value :
LoadBehavior : 0x00000003
Back to My Installer Project MyWordAddInSetup :
right click on it > view > File System :
In the Application Folder I added the Assembly used by my project, the primary output, the manifest and the MyWordAddIn.vsto file.
right click on MyWordAddInSetup > view > Launch Conditions :
set the right .NET FrameWork (4.7.2)
right click on MyWordAddInSetup > view > Registry :
In the HKEY_LOCAL_MACHINE I created the following key tree :
SOFTWARE/Microsoft/Office/Word/Addins/MyWordAddIns
Then, I added three string value in MyWordAddIns :
Manifest : file:///[INSTALLDIR]/MyWordAddIn.vsto|vstolocal
Description : "MyWordAddInName"
FriendlyName : "My word Add-In name"
and 1 binary value :
LoadBehavior : 0x00000003
When Installing my MyWordAddIns, the Assembly, dll, manifest and vsto file are well created inside the chosen folder.
But the local registry is not set with the value I wanted.
If I create it myself then the add-In is correctly added in Word 2016.
I tried to create a simple key 'Test' in the HKEY_LOCAL_MACHINE in the Registry tab of my MyWordAddIns installer. And even that, the 'Test' folder does not appear in the HKEY_LOCAL_MACHINE registry of my machine.
If I set those registry valuenot in the HKEY_LOCAL_MACHINE but in the HKEY_CURRENT_USER it well create the values.
Any solution to corectly set the values in the HKEY_LOCAL_MACHINE ?

I found the problem. It was a user mistake.
To have the key values set in the HKEY_LOCAL_MACHINE you must click on 'Everyon' button during the Installation

Related

why I can not create a VC++ empty project on my windows using vs 2015 ,vs2017,vs2019

in VS 2015, there is a warning dialog 'null' is null or is not object when i try to create a VC++ project:
then i get another warning:
error from HRESULT:800A138F
in VS 2019 i got the warning:
Object reference not set to an instance of an object,
You could try steps below to resolve this issue:
1.Windows+R and enter regedit to open Registry Editor, make sure the value data of Enabled key is set to zero.
We can find the key here:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy
2.Restart VS to check if the issue goes away, if it persists, close all vs instances and delete all folders under path: C:\Users\xxx\AppData\Local\Microsoft\VisualStudio . It will clean all VS cache to reset the VS settings.
Note: AppData is a hidden folder.

.NET Core MSTests fail because of "Illegal characters in path"

When I click Run All .NET Core tests (the MSTest version) they do not run. It fails saying in the bottom left corner "Unexpected error detected. Check the Tests Output Pane for details".
I checked the output and this is the error:
[4/8/2018 19:29:53 Informational] ------ Run test started ------
[4/8/2018 19:29:53 Error] System.ArgumentException: Illegal characters in path.
I created a blank project called "Thing.Tests". The path is
C:\Users\james\OneDrive\Documents\visual studio
2017\Projects\Thing.Tests\Thing.Tests\Thing.Tests.csproj
What the issue is??
Check out your system PATH:
echo %PATH%
I ended up having an entry with double quotes (which Visual Studio didn't like very much). Once I deleted that entry it worked like a charm.
You can edit it through the Environment Variables
Control Panel > System > Advanced System Settings > Environment Variables

Install vcredist_x64 with VS2017 installer project

I currently want to create a installer for a VS2017 project. This project has as prerequisite vcredist_x64.
To create an installer I have installed:
- ClickOnce Publishing (via VS2017 installer)
- Microsoft Visual Studio 2017 Installer Projects (VS2017 Addon by Microsoft)
Now I created a setup project and in properties => prerequisite I selected Visual C++ "14" Runtime Libraries (x64) and Download prerequisites from the component vendor's web site.
If I now start created setup.exe I'm getting on my target machine an error during installing of prerequisites: The following packages could not be found: (there is not a single packages listed).
Log file:
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [NTProductType] = 1 {int}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 10.0.0 {version}
Running checks for package 'Visual C++ "14" Runtime Libraries (x64)', phase BuildList
Running MsiProductCheck with ProductCode '{C99E2ADC-0347-336E-A603-F1992B09D582}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'VCRedistInstalled'
The following properties have been set for package 'Visual C++ "14" Runtime Libraries (x64)':
Property: [VCRedistInstalled] = -1 {int}
Running checks for command 'vc_redist.x64.exe'
Result of running operator 'ValueGreaterThanEqualTo' on property 'VCRedistInstalled' and value '3': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'AMD64': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '6.00': false
Result of checks for command 'vc_redist.x64.exe' is 'Install'
'Visual C++ "14" Runtime Libraries (x64)' RunCheck result: Install Needed
Installation of components 'Visual C++ "14" Runtime Libraries (x64)' was accepted.
Copying files to temporary directory "C:\Users\blubb_user\AppData\Local\Temp\VSD1A14.tmp\"
Error: The following package files could not be found:
In VS 2015 I had same trouble. Fix there was to fix PublicKey in bootstrapp file. But I was not able to find correct PublicKey. I was trying using the PublicKey of signature of matching installer. In C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\product.xml GUID C99E2ADC-0347-336E-A603-F1992B09D582 is mentioned, so I looked for setup with this GUID in C:\ProgramData\Package Cache\ and took this PublicKey.
Any idea how to fix it for VS2017?
Update (Solution):
I was able to fix it for me (VS2017 Update 7):
In packages.xml (C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\en) path of VCRedistExe was invalid.
Instead of
<String Name="VCRedistExe">https://aka.ms/vs/15/release/26405.00/VC_Redist.x64.exe</String>
I have now
<String Name="VCRedistExe">https://aka.ms/vs/15/release/26429.04/VC_Redist.x64.exe</String>
C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\product.xml I changed too
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="Microsoft.Visual.C++.14.0.x64">
<!-- Defines list of files to be copied on build -->
<PackageFiles CopyAllPackageFiles="false">
<PackageFile Name="vc_redist.x64.exe" HomeSite="VCRedistExe" PublicKey="3082010a0282010100a829fed410c8ff550a9e990003528fdcb0bff9abf851fe5c8c54c227ce4c2b96ebdb811ccb862b79ca757eb867832686bdd62f1c3ec758aa8f6f95fb5afca7c61bc1c3e84c174e223db75b565c7fd75af52dbabba609bf067cee98fe40f930b86bfe406f74b3b8d63849c9d087072f31dfb6bc4ea3d09eb7627b5670754f67bf05cca3aebe0092c21b50a1613b100001b186d029f340f50fd9a30f57ab6309a8dca96ae74743a7be15c43d27a4e8565288cf5999a10084369bd039d22a0d2fe604e2bf13968883a95137184189e2f9859d8e651a3d0364ccc5de50705df20b85a98fb145e877ff839d09bb72e0e6560895b92b83128931fce758721dbdf983230203010001" />
</PackageFiles>
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{03EBF679-E886-38AD-8E70-28658449F7F9}"/>
</InstallChecks>
<!-- Defines how to invoke the setup for the Visual C++ 14.0 redist -->
<Commands Reboot="Defer">
<Command PackageFile="vc_redist.x64.exe" Arguments=' /q '>
<!-- These checks determine whether the package is to be installed -->
<InstallConditions>
<BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="3"/>
<!-- Block install if user does not have admin privileges -->
<FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>
<!-- Block install on any platform other than x64 -->
<FailIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="AMD64" String="InvalidOS"/>
<!-- Block install on Vista or below -->
<FailIf Property="VersionNT" Compare="VersionLessThan" Value="6.00" String="InvalidPlatformWinNT"/>
</InstallConditions>
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<ExitCode Value="3010" Result="SuccessReboot"/>
<DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
</ExitCodes>
</Command>
</Commands>
</Product>
I'm not sure about Product="{03EBF679-E886-38AD-8E70-28658449F7F9}", because Setup has GUID {80586c77-db42-44bb-bfc8-7aebbb220c00} (MsiProductCheck does not work with it), so I took GUID from Microsoft Visual C++ 2017 x64 Minimum Runtime - 14.14.26429. Another possibility is to use GUID from Microsoft Visual C++ 2017 x64 Additional Runtime - 14.14.26429 ({B12F584A-DE7A-3EE3-8EC4-8A64DBC0F2A7}). Minimum and Additional Runtime will be installed with script above, so it should doesn't matter which GUID we take.
I had this problem with the x86 redist and was eventually able to blame everything on the MS supplied vcredist_x86\product.xml file. You should be able to apply the same fix to the vcredist_x64\product.xml file.
The problem arises due to file name and public key mismatches with the actual redist file that you download from MS.
You must change the name in both the PackageFiles\PackageFile node and Commands\Command node of product.xml to vcredist_x64.exe, as well as renaming the redist package from MS to vcredist_x64.exe. Then, change the publickey attribute in the PackageFile node to match the public key of the EXE you got from MS. You can get this by looking at the EXE's SHA1 certificate with File Explorer (Properties -> Digital Signatures (SHA1) -> Details -> View Certificate -> Details -> Public Key)
Same problem. Microsoft had a typo in their bootstrapper file. In C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x86\product.xml
replace vcredist_x86.exe with vc_redist.x86.exe and reload Visual Studio.
For vs2015,vs2017,vs2019: I had to right-click select Properties on the VC_redist.x86.exe file, then select Digital Signatures tab, select sha256 (not sha1) as above, then Details button to get the Certificate properties window, then the Details tab on that. Then I had to scroll down to Public Key. From there I had to select and Ctrl+C copy the hexadecimal Public key text from the ASCII dump window below since the Copy to File button only creates .cer files. Then I had to edit the product.xml file in Notepad++ launched in Administrator mode or else you won't be able to save the updated file. After pasting the Public key text into the product.xml file, I had to select the lines of the key and replace all the spaces separating the hex digits with "". Then I replaced the PublicKey value and finally saved.
Does anyone else think it odd that in 2020 the vc_redist.*.exe file still has no versioning reflected in the name, that the download site doesn't indicate the version in the text, does not indicate the public key, and that therefore the only way to know it's been updated since you last downloaded it is to compare the file size with your last version?
Update 2020-11-04: After downloading the latest redist from https://support.microsoft.com/en-ca/help/2977003/the-latest-supported-visual-c-downloads and updating product.xml as above, when installing my application with the updated msi, I get an error indicating "The following package files could not be found: vc_runtimeMinimum_x64.msi". In comparing the vc_redist exe I downloaded today to the one I had been using, I noted it is smaller. Looks like I get to go back to an older version.

Where are the values in AssemblyInfo.cpp generated from?

I just started a project on my HP laptop and visual studio has populated the AssemblyInfo.cpp file with details from the laptop it would seem:
[assembly:AssemblyCompanyAttribute(L"HP")];
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) HP 2017")];
Where are those values coming from and can I change them to match the company I work for so that when I create a new project it comes up with the correct values?
If it's VC++ project,turn to "Resource View",Double click "Version",you can then set your company name or other informations like file version,Description,etc.
Actually,It should be something like a default name:"" or "".Seems no way for you to "set once,use forever".

Sitecore 7 pdf indexing

I try to index PDF files with Sitecore 7.
I installed IFilter , but I received on crawlers log next error :
ManagedPoolThread #17 09:24:20 WARN LuceneIndexOperations : Update : Could not build document data 4433434-3443-3223-91c4-233232. Skipping.
Exception: System.Runtime.InteropServices.COMException
Message: Error HRESULT E_FAIL has been returned from a call to a COM component.
Source: mscorlib
at System.Runtime.InteropServices.ComTypes.IPersistFile.Load(String pszFileName, Int32 dwMode)
at Sitecore.ContentSearch.Extracters.IFilterTextExtraction.FilterLoader.LoadAndInitIFilter(String fileName, String extension)
at Sitecore.ContentSearch.Extracters.IFilterTextExtraction.FilterReader..ctor(String fileName)
at Sitecore.ContentSearch.ComputedFields.MediaItemIFilterTextExtractor.ComputeFieldValue(IIndexable indexable)
at Sitecore.ContentSearch.ComputedFields.MediaItemContentExtractor.ComputeFieldValue(IIndexable indexable)
at Sitecore.ContentSearch.LuceneProvider.LuceneDocumentBuilder.AddComputedIndexFields()
at Sitecore.ContentSearch.LuceneProvider.LuceneIndexOperations.GetIndexData(IIndexable indexable, IIndexable latestVersion, IProviderUpdateContext context)
at Sitecore.ContentSearch.LuceneProvider.LuceneIndexOperations.BuildDataToIndex(IProviderUpdateContext context, IIndexable version, IIndexable latestVersion)
at Sitecore.ContentSearch.LuceneProvider.LuceneIndexOperations.<>c__DisplayClass7.<Update>b__0(Item version)
What I have to do work because on Sitecore documentation they said it must work out of the box.
I had the same issue and I received from Sitecore support next response (it works fine after):
1) Copy all the Adobe iFilter .dll files into the "\System32\Inetsrv" folder. This is the working directory for IIS on Windows Server.
The Adobe iFilter .dll files are stored at the "C:\Program Files\Adobe\Adobe PDF iFilter 9 for 64-bit platforms\bin" folder by default.
Also you can use the "IFilter Explorer" tool to detect the folder where the .dll files are stored:
http://www.citeknet.com/Products/IFilters/IFilterExplorer/tabid/62/Default.aspx
For more details please see the screenshot:
http://screencast.com/t/xmWukanM+
2) Delete all the files under the "Website/App_Data/MediaCache" folder;
3) Rebuild the Sitecore Search Indexes (Sitecore -> Control Panel -> Indexing -> Indexing Manager);
4) Clear the Sitecore cache (the http://{hostname}/sitecore/admin/cache.aspx tool);
5) Restart the IIS;
Here is the solution I took since I didn't like the idea of coping iFilter related DLLs into the system path.
install Adobe IFilter 9 (I used this link). Note version 9 is essential as starting at version X they abandoned file based interface.
add filter location to the PATH environment variable. In my case it was %ProgramFiles%\Adobe\Adobe PDF iFilter 9 for 64-bit platforms\bin\.
run iisreset
go back to Sitecore app and run index rebuild for necessary indexes.
For your consideration:
while trying to resolve the issue I granted full access to IFilter folder for app pool account. I don't think it's necessary as I removed it at the end and everything was still working fine.
After these steps PDF indexing started working fine on my instance of Sitecore 7 running on Windows 8.1.