How to make a CAB File Application for Windows Compact 2013? - compact-framework

I have written an application for Windows Compact 2013 and a CAB Application to generate a CAB Installer (on VS 2013) for the device that is running Windows Compact 2013.
Under Add->Project Output, I have included only Primary Output.
When I try to install the CAB on the Device, it does not get installed and pops up an error.
Is this the correct way to Create a CAB File for an application? If not please suggest the correct method to do so.
P.S. I have followed the method stated on the MSDN Page.

Personnaly, I prefere use a .ini file and generate cab file with CabWiz program.(You can find it at C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools).
A short sample:
; https://msdn.microsoft.com/en-us/windows/hardware/drivers/install/inf-
files
[Version]
Signature="$Windows NT$"
Provider="MyCompany"
CESignature="$Windows CE$"
[Strings]
Manufacturer="MyCompany"
; There put relative path to your sln projet
SlnProjectPath=".."
[CEStrings]
AppName="MyApp"
InstallDir=\Program Files\%Manufacturer%
[CEDevice]
VersionMin=4.0
VersionMax=6.99
BuildMax=0xE0000000
[DefaultInstall]
CEShortcuts=Shortcuts
AddReg=RegKeys
CopyFiles=Files.Binaries
[SourceDisksNames]
1=,"ZgRemoteAppBin",,"%SlnProjectPath%\ZgRemoteApp\bin\Release\Remote\"
2=,"ZgCabInstallerBin",,"%SlnProjectPath%\ExternalLibs\"
[SourceDisksFiles]
"MyLibrary.dll"=1
"MyApp.exe"=1
"Newtonsoft.Json.Compact.dll"=2
[DestinationDirs]
Shortcuts=0,%CE2%\Start Menu
Files.Binaries=0,"%InstallDir%\%AppName%"
[Files.Binaries]
"MyLibrary.dll",,,0
"MyApp.exe",,,0
"Newtonsoft.Json.Compact.dll",,,0
[Shortcuts]
; If you want desktop shorcut for example
[RegKeys]
; https://msdn.microsoft.com/fr-fr/windows/hardware/drivers/install/inf-addreg-directive
; reg-root,[subkey],[value-entry-name],[flags],[value][,[value]]
; Auto start app.
HKLM,Init,Launch99,0x00000000,%InstallDir%\%AppName%\%AppName%.exe

Related

Dotfuscator says "was expecting one of:" when building in Visual Studio

I've got a solution in Visual Studio that includes a Dotfuscator project. The exact same code base builds and obfuscates correctly on another machine (my old laptop), but not on my newly setup laptop. Of course we let our support contract expire since this is used on a legacy project.
The output during the build is:
8>Compiling Project MyAppObfuscation ...
8>Dotfuscator Professional Version 4.41.1.9417-95d9eec7a
8>Copyright 2002-2019 PreEmptive Solutions, LLC All Rights Reserved.
8>Use of this software implies acceptance of accompanying license agreement.
8>Build machine license. This software may be used on binaries for general release.
8>
8>Your protection is out of date. Learn more at https://www.preemptive.com/keep-your-protection-up-to-date?product=dotfuscator&sku=pro&version=4.41.1.9417. Upgrade at https://www.preemptive.com/products/dotfuscator/downloads.
8>
8>Loading Assemblies...
---several of these lines---
8>Running ...\ildasm.exe /OUT=...\MyApp.exe.il /TEXT /NOBAR /RAWEH /QUOTEALLNAMES /UTF8 /LINENUM /FORWARD "...\MyApp.exe"
8>
--- immediately followed by: ---
8>Encountered - at line 18065, column 26.
8>Was expecting one of:
8> <FLOAT64> ...
8> "float64" ...
8> "float32" ...
8> <INT> ...
8> "(" ...
8>
8>Build Error.
8>MyAppObfuscation build failed.
Has anyone encountered this? I'm inclined to believe it's something on the new machine, but if anyone has tips about diagnosing this I would appreciate it.
Thanks!
Edit: Just wanted to add the same error happens in Visual Studio and the Dotfuscator Professional Config Editor.
Edit 2: Upon further inspection, the folder listed in the /OUT parameter of ildasm doesn't contain a .il file for the last ildasm command. The output folder for the assemblies prior to the .exe DO have a .il file. So, I thought ildasm might be failing on the .exe, but I can copy the command into a command prompt and it runs correctly and creates an .il file as expected. So, why would ildasm not work when run from Visual Studio, but would work from the command line -- and only for one assembly / exe in the project?
The mystery grows...
Solved it! I opened Visual Studio Installer on both the old and new machine to compare what features were installed on the old one vs the new one. Most notably, one of the missing features on the Individual components tab was an older .NET Framework SDK (4.6.1 in my case) and an older Windows 10 SDK (10.0.17763.0 in my case).
I hope someone else finds this helpful.

Open .sql extensions in ssms 2008 r2 rather than ssms 2012

I want to open .sql extensions automatically in ssms 2008 r2 rather than ssms 2012 for reasons I won't bore you with. On Windows 7. It can't be done through the normal file types and default programs dialogues as it seems just to associate with the generic program rather than the version, so presumably I need to do something in the registry. Can anyone advise?
Many thanks,
James
Thanks Giorgi, but that didn't work for me. Maybe if I'd rebooted it might have done, but I didn't think we needed to do that these days.
Answer:
Download a 3rd party File Type Manager (Nirsoft FileTypesMan worked for me) and change the entries to the following:
Associate the following program (SSMS 2008 R2) with the file type:
"C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
Associate the following with the Open action:
"C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe" /dde "%1"
In the DDE details for the Open action, add the following:
Message: Open("%1")
Application: sqlwb.9.0
Ifexec: {leave this blank}
Topic: system

where is the "TargetFrameworkSDKToolsDirectory" was defined

I was using msbuild build my sln and get error message "couldn't find 'AxImp.exe' which already exists under %Program files (x86)%\Microsoft sdks\windows\v8.1A. but seems it find sdk from v8.0A, output info point out the error was in Microsoft.Common.targets file(code see below). I didn't found where the "TargetFrameworkSDKToolsDirectory" was defined, anyone can help me?
environment: winblue(4.5.1 sdk v8.1A) without visual studio.
<ResolveComReference
TypeLibNames="#(COMReference)"
TypeLibFiles="#(COMFileReference)"
ResolvedAssemblyReferences="#(ReferencePath)"
WrapperOutputDirectory="$(InteropOutputPath)"
IncludeVersionInInteropName="$(IncludeVersionInInteropName)"
KeyContainer="$(KeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
DelaySign="$(DelaySign)"
StateFile="#(_ResolveComReferenceCache)"
TargetFrameworkVersion="$(TargetFrameworkVersion)"
TargetProcessorArchitecture="$(ProcessorArchitecture)"
NoClassMembers="$(ComReferenceNoClassMembers)"
Silent="$(ResolveComReferenceSilent)"
EnvironmentVariables="$(ResolveComReferenceEnvironment)"
**SdkToolsPath="$(ResolveComReferenceToolPath)"**
ExecuteAsTool="$(ComReferenceExecuteAsTool)"
MSBuildArchitecture="$(ResolveComReferenceMSBuildArchitecture)"
ContinueOnError="$(ContinueOnError)">
<**ResolveComReferenceToolPath** Condition="'$(ResolveComReferenceToolPath)' == ''">$(**TargetFrameworkSDKToolsDirectory**)</ResolveComReferenceToolPath>
Depends on the version and platform you're targeting, but latest is at C:\Program Files (x86)\MSBuild\12.0\Bin\Microsoft.NetFramework.CurrentVersion.props, follow your imports, i.e. <Import Project=".targets" />. To get the values run MSBuild with /v:diag and all evaluated properties will be dumped and the start.
what ended up working for me was installing:
Windows Software Development kit (SDK) for windows 8
even though I'm on widows server 2016
https://developer.microsoft.com/en-us/windows/downloads/windows-8-sdk
I guess the clue was in my error:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2428, 5): error MSB3086: Task could not find "LC.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed

How do I resolve the error ORA-06413: Connection not open?

My local environment VS2012
Using Oracle 10g XE
Dim dbConn As New OleDbConnection
Dim dbComm As OleDbCommand
dbConn.ConnectionString = "Provider=msdaora;Data Source=XE;User ID=scott;Password=tiger"
dbConn.Open()
Tip error: ORA-06413: Connection not open.
Already check the TNSNAMES.ora, SQLNET.ora, LISTENER.ora and its nothing wrong.
But why this error appear?
:(
The error is caused by the parenthesis in the pathname.
possibly you execute VS2012 from C:\program file (x86)...
workaround: create a junction link
steps:
from: command line execute
C:>mkLink /j "Program Files x86" "Program Files (x86)"
and then
fix the (or create a new) shortcut with new path (C:\program file
x86...)
I worked a lot on this problem, I lost a lot of time. Apparently IIS Express in Visual Studio uses the Oracle provider 64 bit.
To solve this problem:
I installed IIS on my PC (Windows 10)
with .NET 4.5 or higher
I compiled the Web API application with 32-bit target.
I publish the web application on my IIS.
On IIS I set enable the apps 32 bit to true
I had the same problem and I resolved the problem installing Oracle 11g Express. Before, I removed all previous Oracle client installation. I use windows 7 64 bit.
Create Bat file to start excel
in bat put path you can adjust to match your folders
start c:\progra~2\micros~1\Office14\Excel.exe
When you start excel just open macro and try :)
I encountered the same problem when working on my Visual studio 2013 project. I was able to run the same project from SVN on a different machine, but it just WON'T work on mine. I checked the connection string and could successfully test the connection in Oracle, but it would throw a disgusting “ORA-06413: Connection not open” error from code.
I got it fixed this way - Install Oracle 11g client -> Select "Administrator" as Type of Installation. Re-open Visual Studio and it worked. Hope it helps!
uninstall your toad or oracle
reinstall on on your window drive ex:(c/d/e) in new folder
don't install in program files (x86)
because program files(x86) is for 32 bit applications
I have resolved the error after the days of searching.
Error Cause:
This error is due to Oracle reserved character "(",")" and in Windows 64 bit there is a folder "Program Files (x86)" which is a creation problem.
Solution:
Create a link folder for "Program Files (x86)" using below command on Window Drive path.
Open cmd as Administrator.
mklink /j "Program Files x86" "Program Files (x86)"
or visit link
download3k article
Open Registry (as Administrator)->Export Registry
Always backup a registry file before changing it. Make a copy of the registry file and work on the copy.
Open Registry file(Copy) in text editor and replace "(x86)" with "x86"
Save the file and import it to your Registry and restart your computer.
Now the "ORA-06413: Connection not open" error goes away.

Windows Mobile Compact Framework Build Error: CAB file … could not be created

I get the following error when trying to build a .CAB in visual studio on my new PC. The source is identical. The Registry warnings are not present on the old PC either.
Windows CE CAB Wizard
Warning: Section [RegKeys] has no data
Warning: Section [DefaultInstall] key "AddReg" - there are no section entries to process
Error: CAB file "D:\Dev\...\MyProject.CAB" could not be created
ERROR: The Windows CE CAB Wizard encountered an error. See the output window for more information.
No other errors show in the build log for the cabwiz.exe build step.
Any suggestions?
Move the source code to C: drive and build it there, instead of D: drive.
It appears that when cabwiz.exe (Visual Studio) is installed on C: drive, it does not like building projects on D: drive.
Similar issues with network drives noted at http://windowsmobilepro.blogspot.co.uk/2005/11/error-cab-file-could-not-be-created-no.html
Finally I found an answer. All my problems comes from the 8.3 file name generation.
You have to check two thing.
Registry key NtfsDisable8dot3NameCreation under
HKLM/SYSTEM/CurrentControlSet/Control/FileSystem
Valid values are:
0 - Disable 8.3 name generation
1 - Enable 8.3 name generation
2 - Name generation will be evaulated by volume settings
Matty Brown suggested the following (not tested, but may help):
Valid values are (Windows 10 1809):
0 - Enable 8dot3 name creation on all volumes on the system
1 - Disable 8dot3 name creation on all volumes on the system
2 - Set 8dot3 name creation on a per volume basis
3 - Disable 8dot3 name creation on all volumes except the system volume
Volume based settings.
You need an admin command prompt. Check 8.3 name generation with
fsutil 8dot3name query d:
where "d:" is your volume
If the result inform you that your volume has disabled 8.3 name generation, you can set it easily with
fsutil 8dot3name set d:
Two more step is needed. You need a restart, and you have to move files from there and move it back to the original place.
The 8.3 name generation linked to the file operations.
Thats all.
I'm happy now with my new W10 ultrabook with VS2008 and a big WinCe 6 solution.
I know it's a bit too late, but I'll leave this tip for future visits:
Check for whitespaces in Solution & CAB project paths, and also in file names.
I ran into this error while trying to build a legacy CAB project on our new TFS Build Server running Windows 2012. Ironically, the script to build the mobile app and CAB project worked fine on my local development machine, but go the vague "Windows CE CAB Wizard Error: CAB file XXXXXX could not be created" error when I ran it on the build server, via both a TFS build definition or manually.
The article previously mentioned at http://windowsmobilepro.blogspot.co.uk/2005/11/error-cab-file-could-not-be-created-no.html was very thorough and helpful. I used the SUBST trick to shorten the project path and eliminate the spaces in the path names, and the script could then run on TFS / Win2012.