Skip to content

Commit

Permalink
update vs project file
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Jun 29, 2020
1 parent 71bedc5 commit b22025d
Show file tree
Hide file tree
Showing 4 changed files with 418 additions and 4 deletions.
183 changes: 183 additions & 0 deletions inno/MCXStudio.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "MCX Studio"
#define MyAppDir "MCXStudio"
#define MyAppVersion "1"
#define MyAppPublisher "COTILab"
#define MyAppURL "http://mcx.space"
#define MyAppExeName "mcxstudio.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{0A4EBE79-4F72-4379-8C40-2A395E069EC8}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppDir}
DisableProgramGroupPage=yes
LicenseFile=..\MCXStudio\MCXSuite\mcx\LICENSE.txt
InfoAfterFile=..\MCXStudio\README.txt
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputBaseFilename=mcxstudio
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ChangesEnvironment=true


[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: envPath; Description: "Add to PATH variable"

[Dirs]
Name: "{app}\MCXSuite"

[Files]
Source: "..\MCXStudio\mcxstudio.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\MCXStudio\plink.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\MCXStudio\pscp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\MCXStudio\README.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\MCXStudio\MATLAB\*"; DestDir: "{code:GetMatlabToolboxLocalPath}"; Excludes: "AUTO_BUILD_*.log"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\MCXStudio\mcxsuite_addpath.m"; DestDir: "{code:GetMatlabToolboxLocalPath}\local"; Flags: ignoreversion
Source: "..\MCXStudio\MCXSuite\*"; DestDir: "{app}\MCXSuite"; Excludes: "AUTO_BUILD_*.log"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "--user"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "--user"; Tasks: desktopicon
Name: "{autoprograms}\MCX Website"; Filename: "http://mcx.space/"
Name: "{autoprograms}\MCX Wiki"; Filename: "http://mcx.space/wiki/"
Name: "{autoprograms}\MCX Forum"; Filename: "https://groups.google.com/forum/?hl=en#!forum/mcx-users"

[Registry]
; Create "Software\My Company\My Program" keys under CURRENT_USER or
; LOCAL_MACHINE depending on administrative or non administrative install
; mode. The flags tell it to always delete the "My Program" key upon
; uninstall, and delete the "My Company" key if there is nothing left in it.
Root: HKA; Subkey: "Software\COTILab"; Flags: uninsdeletekeyifempty
Root: HKA; Subkey: "Software\COTILab\MCXStudio"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\COTILab\MCXStudio\Settings"; ValueType: string; ValueName: "Language"; ValueData: "{language}"
; Associate .mcxp files with My Program (requires ChangesAssociations=yes)
Root: HKA; Subkey: "Software\Classes\.mcxp"; ValueType: string; ValueName: ""; ValueData: "MCXStudio.mcxp"; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mcxp\OpenWithProgids"; ValueType: string; ValueName: "MCXStudio.mcxp"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\MCXStudio.mcxp"; ValueType: string; ValueName: ""; ValueData: "MCXStudio"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\MCXStudio.mcxp\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\mcxstudio.exe,0"
Root: HKA; Subkey: "Software\Classes\MCXStudio.mcxp\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\mcxstudio.exe"" ""%1"""
; HKA (and HKCU) should only be used for settings which are compatible with
; roaming profiles so settings like paths should be written to HKLM, which
; is only possible in administrative install mode.
Root: HKLM; Subkey: "Software\COTILab"; Flags: uninsdeletekeyifempty; Check: IsAdminInstallMode
Root: HKLM; Subkey: "Software\COTILab\MCXStudio"; Flags: uninsdeletekey; Check: IsAdminInstallMode
Root: HKLM; Subkey: "Software\COTILab\MCXStudio\Settings"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"; Check: IsAdminInstallMode
; User specific settings should always be written to HKCU, which should only
; be done in non administrative install mode.
Root: HKCU; Subkey: "Software\COTILab\MCXStudio\Settings"; ValueType: string; ValueName: "UserName"; ValueData: "{userinfoname}"; Check: not IsAdminInstallMode
Root: HKCU; Subkey: "Software\COTILab\MCXStudio\Settings"; ValueType: string; ValueName: "UserOrganization"; ValueData: "{userinfoorg}"; Check: not IsAdminInstallMode

; Fix windows graphics driver watchdog time limit
Root: HKLM; Subkey: "System\CurrentControlSet\Control\GraphicsDrivers"; ValueType: dword; ValueName: "TdrDelay"; ValueData: 10000000

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
const
EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
var
MatlabToolboxLocalPath: string;
function GetMatlabToolboxLocalPath(Param: string): string;
begin
Result := MatlabToolboxLocalPath;
end;
function InitializeSetup(): Boolean;
var
MatlabExePath: string;
begin
MatlabExePath := FileSearch('matlab.exe', GetEnv('PATH'));
if MatlabExePath = '' then
begin
MatlabExePath := ExpandConstant('{app}') + '\MATLAB';
Result := true;
Exit;
end;
MatlabToolboxLocalPath := ExtractFilePath(MatlabExePath) + '..\toolbox';
Result := True;
end;
procedure EnvAddPath(Path: string);
var
Paths: string;
begin
{ Retrieve current path (use empty string if entry not exists) }
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths)
then Paths := '';
{ Skip if string already found in path }
if Pos(';' + Uppercase(Path) + ';', ';' + Uppercase(Paths) + ';') > 0 then exit;
{ App string to the end of the path variable }
Paths := Paths + ';'+ Path +';'
{ Overwrite (or create if missing) path environment variable }
if RegWriteStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths)
then Log(Format('The [%s] added to PATH: [%s]', [Path, Paths]))
else Log(Format('Error while adding the [%s] to PATH: [%s]', [Path, Paths]));
end;
procedure EnvRemovePath(Path: string);
var
Paths: string;
P: Integer;
begin
{ Skip if registry entry not exists }
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths) then
exit;
{ Skip if string not found in path }
P := Pos(';' + Uppercase(Path) + ';', ';' + Uppercase(Paths) + ';');
if P = 0 then exit;
{ Update path variable }
Delete(Paths, P - 1, Length(Path) + 1);
{ Overwrite path environment variable }
if RegWriteStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths)
then Log(Format('The [%s] removed from PATH: [%s]', [Path, Paths]))
else Log(Format('Error while removing the [%s] from PATH: [%s]', [Path, Paths]));
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep = ssPostInstall) and (IsTaskSelected('envPath')) then begin
EnvAddPath(ExpandConstant('{app}'));
EnvAddPath(ExpandConstant('{app}') +'\MCXSuite\mcx\bin');
EnvAddPath(ExpandConstant('{app}') +'\MCXSuite\mmc\bin');
EnvAddPath(ExpandConstant('{app}') +'\MCXSuite\mcxcl\bin');
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usPostUninstall then
begin
EnvRemovePath(ExpandConstant('{app}'));
EnvRemovePath(ExpandConstant('{app}') +'\MCXSuite\mcx\bin');
EnvRemovePath(ExpandConstant('{app}') +'\MCXSuite\mmc\bin');
EnvRemovePath(ExpandConstant('{app}') +'\MCXSuite\mcxcl\bin');
end;
end;
3 changes: 2 additions & 1 deletion src/ubj/ubjrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ static UBJ_TYPE optimize_type(UBJ_TYPE typein,ubjr_dynamic_t* vals, size_t sz)
{
static const uint32_t intmask = (1 << UBJ_INT8) | (1 << UBJ_UINT8) | (1 << UBJ_INT16) | (1 << UBJ_INT32) | (1 << UBJ_INT64);
static const uint32_t stringmask = (1 << UBJ_STRING) | (1 << UBJ_CHAR);
uint32_t tm;
if (typein != UBJ_MIXED)
return typein;
//integer optimization can be done here...
uint32_t tm = compute_typemask(vals, sz);
tm = compute_typemask(vals, sz);
if ((tm & intmask) == tm) //if all values are integers
{
return compute_best_integer_type(vals,sz); //calculate the optimum type given the data
Expand Down
61 changes: 59 additions & 2 deletions vsproj/mcx/mcx/mcx.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>D:\Users\fangq\Gitroot\Project\github\mcx\src\zmat\easylzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>zlib.lib;cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>echo copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"
Expand Down Expand Up @@ -198,16 +199,72 @@ copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command>
<ClInclude Include="..\..\..\src\mcx_shapes.h" />
<ClInclude Include="..\..\..\src\mcx_utils.h" />
<ClInclude Include="..\..\..\src\tictoc.h" />
<ClInclude Include="..\..\..\src\ubj\ubj.h" />
<ClInclude Include="..\..\..\src\ubj\ubj_internal.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\common_internal.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\easylzma\common.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\easylzma\compress.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\easylzma\decompress.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\lzip_header.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\lzma_header.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\7zBuf.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\7zCrc.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\7zFile.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\7zVersion.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\Alloc.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\Bcj2.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\Bra.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\CpuArch.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\LzFind.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\LzHash.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\LzmaDec.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\LzmaEnc.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\LzmaLib.h" />
<ClInclude Include="..\..\..\src\zmat\easylzma\pavlov\Types.h" />
<ClInclude Include="..\..\..\src\zmat\lz4\lz4.h" />
<ClInclude Include="..\..\..\src\zmat\lz4\lz4hc.h" />
<ClInclude Include="..\..\..\src\zmat\zmatlib.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\cjson\cJSON.c" />
<ClCompile Include="..\..\..\src\mcextreme.c" />
<ClCompile Include="..\..\..\src\mcx_shapes.c" />
<ClCompile Include="..\..\..\src\mcx_utils.c" />
<ClCompile Include="..\..\..\src\tictoc.c" />
<ClCompile Include="..\..\..\src\ubj\ubjr.c" />
<ClCompile Include="..\..\..\src\ubj\ubjrw.c" />
<ClCompile Include="..\..\..\src\ubj\ubjw.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\common_internal.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\compress.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\decompress.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\lzip_header.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\lzma_header.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\7zBuf.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\7zBuf2.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\7zCrc.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\7zFile.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\7zStream.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\Alloc.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\Bcj2.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\Bra.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\Bra86.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\BraIA64.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\LzFind.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\LzmaDec.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\LzmaEnc.c" />
<ClCompile Include="..\..\..\src\zmat\easylzma\pavlov\LzmaLib.c" />
<ClCompile Include="..\..\..\src\zmat\lz4\lz4.c" />
<ClCompile Include="..\..\..\src\zmat\lz4\lz4hc.c" />
<ClCompile Include="..\..\..\src\zmat\zmatlib.c" />
</ItemGroup>
<ItemGroup>
<Library Include="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\zlibstatic.lib" />
</ItemGroup>
<ItemGroup>
<None Include="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\zlib.dll" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 8.0.targets" />
</ImportGroup>
</Project>
</Project>
Loading

0 comments on commit b22025d

Please sign in to comment.