Tuesday, October 3, 2017

How to digital sign the one click installer build by wix

I sign the wix build one click installer. use signtool , got below exception:

i336: Acquiring container: WixAttachedContainer, copy from: C:\Users\test\Desktop\TestInstaller.exe 
i000: Setting string variable 'WixBundleLastUsedSource' to value 'C:\Users\test\Desktop\' 
e000: Error 0x80070001: Failed to extract all files from container, erf: 1:2:0 
e000: Error 0x80070001: Failed to wait for operation complete. 
e000: Error 0x80070001: Failed to open container. 
e000: Error 0x80070001: Failed to open container: WixAttachedContainer. 
e312: Failed to extract payloads from container: WixAttachedContainer to working path: C:\Users\test\AppData\Local\Temp\{8d17e055-d90d-4704-a556-bd5807e85920}\6C513FAEDC30F50DCA80F4305E027697FF9E50F8, error: 0x80070001. 
e000: Error 0x80070001: Failed while caching, aborting execution. 
i330: Removed bundle dependency provider: {8d17e055-d90d-4704-a556-bd5807e85920} 
i352: Removing cached bundle: {8d17e055-d90d-4704-a556-bd5807e85920}, from path: C:\ProgramData\Package Cache\{8d17e055-d90d-4704-a556-bd5807e85920}\ 
i399: Apply complete, result: 0x80070001, restart: None, ba requested restart:  No 


to fix it:


1. Build your bundle (using candle/light). 
    My light output was "TestInstaller.exe" 

2. detach the engine from TestInstaller.exe: 
    insignia -ib TestInstaller.exe -o engine.exe 

3. sign engine.exe with your certificate: 

4. re-attach the signed engine.exe to the bundle: 
    insignia -ab engine.exe TestInstaller.exe -o TestInstaller.exe 

5. sign TestInstaller.exe with your certificate. 

Thanks Jonks,
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Burn-3-8-1128-Error-0x80070001-Failed-to-extract-all-files-from-container-erf-1-2-0-td7593695.html

Tuesday, August 1, 2017

How to statically link the C++ REST SDK (Casablanca)

1 Download code
git clone https://github.com/Microsoft/cpprestsdk.git

2 Open solution in Visual Studio
cpprestsdk120.sln

   Change from dynamic to static linking
 
Select All Configurations and All Platforms from the drop-downs at the top of the Properties dialog.

In Configuration Properties -> General -> Project Defaults, change the Configuration Type option to Static library (.lib).

In Configuration Properties -> C/C++ -> Code Generation, change the Runtime Library option to Multi-threaded Debug (/MTd) for the Debug configuration and Multi-threaded (/MT) for the Release configuration.

In Configuration Properties -> C/C++ -> Preprocessor for All Configurations, add the text _NO_ASYNCRTIMP; to the Preprocessor Definitions option. This prevents the compiler from trying to export the functions to a DLL.

Click OK to save the changes.

3: Prepare your application

Open the solution for the application you want to build, right-click on it and choose Properties.

Select All Configurations and All Platforms from the drop-downs at the top of the Properties dialog.

In Configuration Properties -> VC++ Directories, add a new entry in Include Directories as follows:

C:\PathToCppRESTSDK\Release\include

In Configuration Properties -> VC++ Directories, add a new entry in Library Directories as follows:

C:\PathToCppRESTSDK\Binaries\Win32\$(Configuration)

In Configuration Properties -> C/C++ -> Preprocessor, add the text _NO_ASYNCRTIMP; to the Preprocessor Definitions option. This prevents the compiler from trying to find the C++ REST SDK functions from a DLL.

In Configuration Properties -> Linker -> Input, add winhttp.lib ,  Bcrypt.lib, Crypt32.lib and cpprest120_2_3.lib (replacing the numbers with the correct Visual Studio and C++ REST SDK version numbers) to the Additional Dependencies option.

Build your project.


https://katyscode.wordpress.com/2014/04/01/how-to-statically-link-the-c-rest-sdk-casablanca/

Change is missing 2  library.

Tuesday, July 25, 2017

Mac os create group command line

list group.

dscacheutil -q group
sudo dseditgroup -o edit -a $username_to_add -t user admin

Mac group:

sudo dscl . -create /Groups/groupname
sudo dscl . –create /Groups/groupname name groupname
sudo dscl . –create /Groups/groupname gid   groupid
sudo dscl . –create /Groups/groupname GroupMembership usershorname


list group members

dscacheutil -q group -a name pam_idq

sudo dscl . –delete /Groups/groupname GroupMemebership usershorname

sudo dscl . –delete /Groups/groupname