在Inno Setup FAQ中有一个如何为我的软件分配文件类型的示例.处理注册表是没有问题的.
但我怎么能为用户提供的选择它的文件类型,他希望分配?假设我已经为文本文件编写了一个简单的编辑器,并想询问用户是否想要将.txt和/或.nfo与我的程序一起分配.带有复选框的设置页面将是天才.
使用Inno Setup如何做到这一点?
我必须将文件上传到FTP服务器.文件名包含特殊字母äöü.在FTP服务器上,我需要文件名为UTF-8编码.
我的代码是这样的:
import org.apache.commons.net.ftp.FTPClient;
FTPClient client = new FTPClient();
...
boolean retval = client.storeFile(fileName, inputStream);
Run Code Online (Sandbox Code Playgroud)
问题是之后storeFile,FTP服务器上保存的文件名是ISO-8859-1编码而不是UTF-8.
如何告诉FTPClientUTF-8编码文件名?
我看过以下帖子.我的代码看起来完全相同,但不起作用:
Inno Setup检查运行过程
我从http://www.vincenzo.net/isxkb/index.php?title=PSVince复制了这个例子
但是这个例子也不起作用,即使我改变了这样的代码:
[Code]
function IsModuleLoaded(modulename: AnsiString): Boolean;
external 'IsModuleLoaded@files:psvince.dll stdcall';
Run Code Online (Sandbox Code Playgroud)
代码总是返回false(程序没有运行,即使它正在运行).在Windows 2008 R2和Windows 7上测试过.
事实上我想检查,如果它tomcat5.exe正在运行.所以我想我不能用AppMutex.
我也看过https://code.google.com/p/psvince/source/detail?r=5
但我找不到有关该DLL兼容性的任何事实.
完整代码:
[Files]
Source: psvince.dll; Flags: dontcopy
[Code]
function IsModuleLoaded(modulename: AnsiString ): Boolean;
external 'IsModuleLoaded@files:psvince.dll stdcall';
function InitializeSetup(): Boolean;
begin
if(IsModuleLoaded( 'notepad.exe' )) then
begin
MsgBox('Running', mbInformation, MB_OK);
Result := false;
end
else
begin
MsgBox('Not running', mbInformation, MB_OK);
Result := true;
end
end;
Run Code Online (Sandbox Code Playgroud) 我已经阅读了一篇文章,并且找不到适用于我所拥有的"解决方案".
我正在尝试使用php脚本通过SFTP上传文件.我已成功使用CyberDuck连接,但我需要以编程方式执行此操作.
我有一个来自我在CyberDuck中使用的供应商的.PPK文件.我有一个用户名.我有主机名.如果我打开PPK文件,我会看到一些公共线路,专线和私有MAC.
无论如何我可以使用我的信息访问服务器以执行我需要做的事情吗?
这是我正在玩的代码:
<?php if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist");
?>
<?php
$conn = ssh2_connect('hostname.com', 22);
echo $conn;
ssh2_auth_pubkey_file($conn,'USERNAME','/var/www/html/FILENAME.PPK');
// send a file
ssh2_scp_send($conn, '/var/www/html/FILETOSEND.TXT', 'FILETOSEND.TXT', 0644);
?>
Run Code Online (Sandbox Code Playgroud)
我没有收到任何错误,但文件没有显示在服务器上.我可以确认我的webhost上安装了SSH2.
感谢您的任何帮助,您可以提供.
这不会下载子目录的内容; 我怎么能这样做?
import ftplib
import configparser
import os
directories = []
def add_directory(line):
if line.startswith('d'):
bits = line.split()
dirname = bits[8]
directories.append(dirname)
def makeDir(archiveTo):
for dir in directories:
newDir = os.path.join(archiveTo, dir)
if os.path.isdir(newDir) == True:
print("Directory \"" + dir + "\" already exists!")
else:
os.mkdir(newDir)
def getFiles(archiveTo, ftp):
files = ftp.nlst()
for filename in files:
try:
directories.index(filename)
except:
ftp.retrbinary('RETR %s' % filename, open(os.path.join(archiveTo, filename), 'wb').write)
def runBackups():
#Load INI
filename = 'connections.ini'
config = configparser.SafeConfigParser()
config.read(filename)
connections = config.sections() …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Inno Setup部署ASP.NET应用程序.
我需要执行以下任务:
我找到了一个创建虚拟目录的脚本,但我需要一个应用程序和应用程序池:
procedure CreateIISVirtualDir();
var
IIS, WebSite, WebServer, WebRoot, VDir: Variant;
ErrorCode: Integer;
begin
{ Create the main IIS COM Automation object }
try
IIS := CreateOleObject('IISNamespace');
except
RaiseException(
'Please install Microsoft IIS first.'#13#13'(Error ''' +
GetExceptionMessage + ''' occurred)');
end;
{ Connect to the IIS server }
WebSite := IIS.GetObject('IIsWebService', IISServerName + '/w3svc');
WebServer := WebSite.GetObject('IIsWebServer', IISServerNumber);
WebRoot := WebServer.GetObject('IIsWebVirtualDir', 'Root');
{ (Re)create a virtual dir }
try
WebRoot.Delete('IIsWebVirtualDir', 'eipwebv4');
WebRoot.SetInfo();
except
end;
VDir …Run Code Online (Sandbox Code Playgroud) 我试图使用JSch库通过SSH协议执行多个命令.但我似乎陷入困境,无法找到任何解决方案.该setCommand()方法每个会话只能执行单个命令.但我想按顺序执行命令,就像Android平台上的connectbot应用程序一样.到目前为止我的代码是:
package com.example.ssh;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Properties;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
public class ExampleSSH extends Activity {
/** Called when the activity is first created. */
EditText command;
TextView result;
Session session;
ByteArrayOutputStream baos;
ByteArrayInputStream bais;
Channel channel;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
bais = new ByteArrayInputStream(new byte[1000]);
command = (EditText) findViewById(R.id.editText1);
result = (TextView) …Run Code Online (Sandbox Code Playgroud) 大家好
我怎样才能使用Inno设置获取用户的本地IP地址?我认为使用win32 api GetIpAddrTable,但目前还不清楚如何进行调整.有人有其他任何方式吗?或者知道怎么做?坦克
对于Windows 8应用程序认证,有(以及其他)这些要求:
/SafeSEH标志编译您的应用程序,以确保安全的异常处理/NXCOMPAT标志编译您的应用程序以防止数据执行/DYNAMICBASE地址空间布局随机化(ASLR)标志进行编译我无法在C++ Builder XE中找到如何启用其中任何一个.
对于/NXCOMPAT和/DYNAMICBASE,可以使用editbin.exeVS或peflags.exeCygwin.虽然我对可能的副作用更有信心,但如果有本地方式来启用这些副作用.
无论如何,我完全不知所措/SafeSEH.
如何在Inno Setup中静默安装Microsoft VC++可再发行组件?我使用了以下代码,除安装进度窗口外,大多数安装部分都是静默的.
这是我的[Run]部分代码: -
[Run]
Filename: "{app}\bin\vcredist_x86.exe"; \
Parameters: "/passive /verysilent /norestart /q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """; \
Check: VCRedistNeedsInstall; WorkingDir: {app}\bin;Flags: runminimized nowait; \
StatusMsg: Installing CRT...
Run Code Online (Sandbox Code Playgroud)